From patchwork Sat Feb 17 02:25:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13561215 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC7D4C48BEF for ; Sat, 17 Feb 2024 02:26:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6195C6B00A9; Fri, 16 Feb 2024 21:26:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5C8726B00AA; Fri, 16 Feb 2024 21:26:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 41AFA6B00AC; Fri, 16 Feb 2024 21:26:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 2F4FD6B00A9 for ; Fri, 16 Feb 2024 21:26:01 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 0E17514012F for ; Sat, 17 Feb 2024 02:26:01 +0000 (UTC) X-FDA: 81799705722.17.1A0613C Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf28.hostedemail.com (Postfix) with ESMTP id 90D98C0015 for ; Sat, 17 Feb 2024 02:25:59 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=EUdRxko7; dmarc=none; spf=none (imf28.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708136759; a=rsa-sha256; cv=none; b=cOKRxffJq+Do8R5GxOOzDL73MCP6r4qEfNdovq/27Gy25P9ysr/u2cITNKl3SMIxo41jTl V2gMaBdZtuGScWXBsA0+k8AYEqycg3s8yYDrjXWP2PxcRYC18CaFDDyrhZ7aEpLMekX42R KMP8dfTd4kR4Ph7sAYXzYZxKpVDNBZ0= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=EUdRxko7; dmarc=none; spf=none (imf28.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708136759; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=PU6ugP91krgUdfd/+R+e4wrMYZesh+3xPHxHX0SsH9A=; b=n12Zf6Vb7qp8vXxY8nhD2yOuWmHFqAaDgCU5g7Ocnt1gQiBzy6hCV/+c0mBLwguuxkaZZv /kJeIwgh2KwRYWtXN4rz5QTUiHOOcaAnGjucubpicuAVI9T0i/mBVmB2W9zTHK+Dusk4Ki 9JVidpE1SkxHgnc28efmAQuLqejQA1U= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=PU6ugP91krgUdfd/+R+e4wrMYZesh+3xPHxHX0SsH9A=; b=EUdRxko7M7qehAKii7MvZGshdP 7eMxyBsqY1HCAFZcmYVh1FWNeuTD+M9exLD5nM2RuFHWF1XMRz7bbijE8jIg+YZRY0cTBB5aa3dTw 39jJpyIzzcq89P7Syh4qEYbd/mjIk/1aaQNdi99c6NT4EhRI4JQTL+9RYOY0rCNW0XTrYYw4tX9ye 7QIV4dp2W9N60wFQ2Je+t4Ecgtt5rsMEULdL7FmZlW4B/qhQ/ouctBd+IvYskPj0K8AhTUlQ8B10B 0aI8MPJI8+285GAo0Uzy38dXj/hFMRGspY59SeRLPh6tavcg4OWdC3AmKzy9Ryo1rcn+FwKWuV7tK LqkiorPw==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rbAOj-00000006HDP-0ILD; Sat, 17 Feb 2024 02:25:49 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, Ryan Roberts Subject: [PATCH v2 10/18] mm: Allow non-hugetlb large folios to be batch processed Date: Sat, 17 Feb 2024 02:25:36 +0000 Message-ID: <20240217022546.1496101-11-willy@infradead.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240217022546.1496101-1-willy@infradead.org> References: <20240217022546.1496101-1-willy@infradead.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 90D98C0015 X-Stat-Signature: rycc6s3cpqk16ogbid98563xsrcxf4ii X-HE-Tag: 1708136759-315450 X-HE-Meta: U2FsdGVkX1+4nylLf+0JOX41MBS65fCNbMO0aBkOM/YmGN0HDtHK7JxPMzzzrY7KOtaTPxOj1qFoKgR7mj3wZ0ZeAeGizmpZ6q5o9ooBQXrWmPZ2q8Ab6uetdaxs6X6IxA4oHZAxbelX1sw5ucORHO69pAI+PITaPlClMC8lxoh+5RsOykxTqAnr/Kub6zqOuoStTzzTK66VXk8RdAYXFN2s20I77oIQNE64Js/P+tHIjvpyjKYDROKkKUmIaRa+Agu/0MldmwvnVN+zFshc3WcVbtiYnNQ8UPCDKkzV09/HUT/2/J8ixMsv+SD8eFZAqWnKmAl6Wwdv86MUlUj7s8ryG7+NQrsWC0zduiYn8Aa3v2ds0x3S16tAz/KBbHXv05Z4vNt6KYa4quZZjIw64xlRojEP25m9z6EGk6AW1aKRYwsfxobDZrJu+O5yZP3xg0ulItvaHIWmgDzUHI5YXPXSWa/MslVJIo43pv3vzuAB8lPi/lDTUeHsawWaz5i6sSIXHSioxYXg2ZBeGTV/x62RUnO2Rk8GBahBIN4gHVKoKA6Rczkf5KuRgTy4Rr/zJaZYBczCHs7F7+PuAu66/PdqaPswU3mHqTsqw1zhIwIbYUsFdXvkEij03Hhu7dsk5Xlv4wy23bSzg4Jwi8VvgYxs7nTVU2PJJUfno1pnU8SEyaTAMJiwvva4Jfc7f33Br/FXsIBcIwskcEHCCvSeH6/FKpcvfoVgXxB2+LjXIABTcJrbhn3deZh3L3t4icwJir1vuwZQjDjncg0Eqg3onSpnShi1+HYBsLRrdHTbmAlLXaPDucWOKE3tZqHbX664NsMk5YeCTAzP098ErEFiLk2RXIInYctqAVBqN7pZ0tlmsmSiyIKHOw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Hugetlb folios still get special treatment, but normal large folios can now be freed by free_unref_folios(). This should have a reasonable performance impact, TBD. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Ryan Roberts --- mm/swap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/swap.c b/mm/swap.c index 21c2df0f7928..8bd15402cd8f 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -1000,12 +1000,13 @@ void folios_put(struct folio_batch *folios) if (!folio_put_testzero(folio)) continue; - if (folio_test_large(folio)) { + /* hugetlb has its own memcg */ + if (folio_test_hugetlb(folio)) { if (lruvec) { unlock_page_lruvec_irqrestore(lruvec, flags); lruvec = NULL; } - __folio_put_large(folio); + free_huge_folio(folio); continue; }