From patchwork Thu Dec 28 08:57:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13505701 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 39C67C3DA6E for ; Thu, 28 Dec 2023 08:58:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1C17E8D000E; Thu, 28 Dec 2023 03:58:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 147EF8D0009; Thu, 28 Dec 2023 03:58:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F03298D000E; Thu, 28 Dec 2023 03:58:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id D50D68D0009 for ; Thu, 28 Dec 2023 03:58:12 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id B5963C0200 for ; Thu, 28 Dec 2023 08:58:12 +0000 (UTC) X-FDA: 81615625224.28.2185916 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf25.hostedemail.com (Postfix) with ESMTP id 24E5EA000A for ; Thu, 28 Dec 2023 08:58:10 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=emlQNTBY; dmarc=none; spf=none (imf25.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=1703753891; a=rsa-sha256; cv=none; b=APAfrOivJLYoqPy8moonF52+AsZMYZyuTaFCi53YS4Cab5xws6/YcMD8GdebliRv6g3FyV I6kaKnCIrVckw29jH+jb7ubhKrAgvz2ON7EcA2f9Zt8DuuCsiAlXQ9u3y1mWDxVNoFx5g3 bDJOhQcnW9UI/D+rMi3Mfa9jT2yHLkY= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=emlQNTBY; dmarc=none; spf=none (imf25.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=1703753891; 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=GhhQuJ3+6FTAb9vQaTHlr2F4XA41XqKfiSBVLqouEBI=; b=EmCyWVVTh8GDWmoE1Nim0Otlatp+BgJd52abii+XnzBD4S5b4yT457daq2A2YTsVd44hcg L/dIRp2qwINFKnXJZBW3oGk7PEYKKrsSKzmAR9xDVe4lSlb+LiRmCJ25oSXfP4+rdipzqc 6tUAzrTRN+mSA9hCHkP4w4Ip5X4U5qI= 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=GhhQuJ3+6FTAb9vQaTHlr2F4XA41XqKfiSBVLqouEBI=; b=emlQNTBYOwVQklEZExnp4PTDzW +YITwvtKDuaDgcvuRGwnI2sJnvHqk3pCvFi8sNadfCHDokq/ge8YGFFaPMRnWKMyXVzgnTWmu/3DY hkDZFADx9GNMRNysxvdLxLD9HzhHs/t5h1lJE4yxMLRyNlh2eLpCBRpE5JlUkm+kfVkcmm3KbWXkb tkKFvvGWv/xoU7NM3kljYopxInuTVds+H3nr+3O4+8AI0OpkhWFtlry97nYwK82NkQYS+genzYsvG KOzLr5TBgKvyA1Vn+HP0JKjYceX9n1yt8ZmLiDrj2oGB6muaXYAAaJS4G4Cp+kI6eapb47WSB2JjA PM5oXV8g==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1rImD8-004XzG-76; Thu, 28 Dec 2023 08:57:50 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, Johannes Weiner , Vlastimil Babka , Hyeonggon Yoo <42.hyeyoo@gmail.com> Subject: [PATCH v2 3/6] slub: Use folio APIs in free_large_kmalloc() Date: Thu, 28 Dec 2023 08:57:45 +0000 Message-Id: <20231228085748.1083901-4-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20231228085748.1083901-1-willy@infradead.org> References: <20231228085748.1083901-1-willy@infradead.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 24E5EA000A X-Stat-Signature: d4ys9goz6e3j3u57qbkbtqd9xs6wt4c6 X-HE-Tag: 1703753890-135954 X-HE-Meta: U2FsdGVkX18/6gMgF/P1aic1BKuPMVjRp6qis/DMo+FwTS6JgPU4txJ9mrHACovo4wfG3H3pTiGe1byZ7ByBbIBJy9jiaatDtVpIYyWbzHSGdXZtdoypEXlZzvNO05/PhOGPfFErD3fE7lEK6EKCIWUi5ymwsCY7+MS97epQLfhoutb40H3m9d+MsKrSn802Mzte61NFeVoPbxXejMaMB+2m+IXWkF7565h+AH22my9SNSlvf7v88iDSSmHAjpvlMwYTYOHpztMrf0PbWo/9wK5STLKVOIkk/PrJGOUPpXX8LNo47Y4/E9mjpXzzOViit7rzg2xbMpoR8a3RUurhg8HBD0fWr6JvA6Kxd8CstYUEU3NDZNUffy257+K4mwbmXscpbUn8wYekaEhSsIq1ixf3mDBfx4Xv2nmYUISTZzjbJX3gNnkP51jWykkmXHN4nPEUmWDWWDWej/XMx3bXxQFbYjuDredSQ/N9IqzWOxUXhgGwsU8eSZA5ehPyWATI4+Yt492wAqSQrD/KRjP/jSI5owDT1qtr1+LZXGNUC9CIMl3ADSxDkWLKxJys+89YKgKXxkP/vCTbLYCjVwl0afMP0s5Sb8I4+KJrgndLzs5NrybGOrPH11fIOzQ3XpHAYXOeFseU0FpQuUuYMZH0ebgNK3c4v4PVzLeEhapDI9bJrwC+S2MRlxX2TnBGwzz52jpb46iPOkogljNNmJ2Bt1U+0eYDOlf5irprNPdiK+3z/0jS1TKuBJhFH/B+pcOCbE7no8nkpXCiyZx2q/mX0gJeie0UFzjPW27Dh+ZErFxdVUctgET1j/weRoPphJkwzguFOP92ul0BSrBJ3x/eccRzZ0Q/8do7TFCKmhYuQQsKzpm+2ziHcyVK5gGVFYovDyaOlTcAok7fAE/yijv3PMThXUsFymk+9lLS6qYqY1IodM8RHx5kJ+ryXsy1nkClSEYHRh0ITXNZf8F2SNO XDtIzM0o w7a93/RsgVaAz33w2peAmb7tK0Q4971MAE8c5HJEAzQYDSBFkSVhv5t1o8ysjtAwibxGoyQsIcm/zAEdl0CIQlMscifh5GNO2a4P7bYad5u2pEetz+5T7ZVwTKl1/ugmiJMpK3Kbd/2LRZFMxnNAuVHk454QzAT18zjuambirS/yU+eCFI5bd6AeQ9dQE6Ygofb6AjA2m0Dzlet2etkbj1KXV8DNlCkX5VGP/ZHYQqk0zyeP4d5/LDLgbn2OYo/ydqJuBsWsNcJBdlBK/qYpePn58+9nEqM6YBelBsu+BsxGOWRQ= 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: Save a few calls to compound_head() by using the folio APIs directly. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: David Rientjes Reviewed-by: Vlastimil Babka --- mm/slub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 342545775df6..58b4936f2a29 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -4375,9 +4375,9 @@ static void free_large_kmalloc(struct folio *folio, void *object) kasan_kfree_large(object); kmsan_kfree_large(object); - mod_lruvec_page_state(folio_page(folio, 0), NR_SLAB_UNRECLAIMABLE_B, + lruvec_stat_mod_folio(folio, NR_SLAB_UNRECLAIMABLE_B, -(PAGE_SIZE << order)); - __free_pages(folio_page(folio, 0), order); + folio_put(folio); } /**