From patchwork Mon Oct 4 13:45:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12533971 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5329FC433F5 for ; Mon, 4 Oct 2021 13:54:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0596861184 for ; Mon, 4 Oct 2021 13:54:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0596861184 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 98879940019; Mon, 4 Oct 2021 09:54:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9382194000B; Mon, 4 Oct 2021 09:54:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 84EBD940019; Mon, 4 Oct 2021 09:54:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0048.hostedemail.com [216.40.44.48]) by kanga.kvack.org (Postfix) with ESMTP id 79BD594000B for ; Mon, 4 Oct 2021 09:54:10 -0400 (EDT) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 37C0582499A8 for ; Mon, 4 Oct 2021 13:54:10 +0000 (UTC) X-FDA: 78658899060.31.2515527 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf14.hostedemail.com (Postfix) with ESMTP id D44B5600209A for ; Mon, 4 Oct 2021 13:54:09 +0000 (UTC) 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=YEIZzBsSgMV0Vd/2EhX1IJVUdiK352avcGgYQAQX3Gs=; b=A1zYJxBVYGImKFAYTbA+20ofoO sOgojN1mJXyNFPvkPD4fdT5AAnPpbJ1WlJsh5OjiMjNI5pdaoqUavHrPEowHT4HTi1s+IAD8k80na TV6Wse71a82QStFpn22kNsQ5eAVw256L+yFnUimiF5rd9Y6kcqEe0URgTM/zFz2Q3PJ6TdIlpBxLx OoNurUocG+KNE/7iHZ3owKy7mFsBdSY0vwKGr40ua9beYUYIEhlDzHAxMkQtKnfIyzpVInlYV05yz cmeX++HnmfKxjpq287DWvwF7wLY0DfUQSTq03lJsdlimZafOCBVh7akhkRO+HPzdicoq3ismHuPPS in6Z4mvA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXONw-00GvQy-1G; Mon, 04 Oct 2021 13:52:33 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" Subject: [PATCH 04/62] mm: Add account_slab() and unaccount_slab() Date: Mon, 4 Oct 2021 14:45:52 +0100 Message-Id: <20211004134650.4031813-5-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211004134650.4031813-1-willy@infradead.org> References: <20211004134650.4031813-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: D44B5600209A X-Stat-Signature: nfbxh59f4xgcmdrn3iy6kszjkss14zjs Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=A1zYJxBV; spf=none (imf14.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Rspamd-Server: rspam06 X-HE-Tag: 1633355649-658112 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: These functions simply call their page equivalents for now. Signed-off-by: Matthew Wilcox (Oracle) --- mm/slab.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mm/slab.h b/mm/slab.h index 54b05f4d9eb5..305cc8c7fed8 100644 --- a/mm/slab.h +++ b/mm/slab.h @@ -510,6 +510,18 @@ static __always_inline void unaccount_slab_page(struct page *page, int order, -(PAGE_SIZE << order)); } +static __always_inline void account_slab(struct slab *slab, int order, + struct kmem_cache *s, gfp_t gfp) +{ + account_slab_page(slab_page(slab), order, s, gfp); +} + +static __always_inline void unaccount_slab(struct slab *slab, int order, + struct kmem_cache *s) +{ + unaccount_slab_page(slab_page(slab), order, s); +} + static inline struct kmem_cache *cache_from_obj(struct kmem_cache *s, void *x) { struct kmem_cache *cachep;