From patchwork Mon Oct 4 13:46:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthew Wilcox (Oracle)" X-Patchwork-Id: 12534105 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 B0F10C433EF for ; Mon, 4 Oct 2021 14:21:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 56A1761244 for ; Mon, 4 Oct 2021 14:21:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 56A1761244 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 EE7B5940030; Mon, 4 Oct 2021 10:21:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E969994000B; Mon, 4 Oct 2021 10:21:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D5ECF940030; Mon, 4 Oct 2021 10:21:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0030.hostedemail.com [216.40.44.30]) by kanga.kvack.org (Postfix) with ESMTP id C4DCC94000B for ; Mon, 4 Oct 2021 10:21:35 -0400 (EDT) Received: from smtpin36.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 871EB2D232 for ; Mon, 4 Oct 2021 14:21:35 +0000 (UTC) X-FDA: 78658968150.36.736F0FF Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf02.hostedemail.com (Postfix) with ESMTP id 45DF770021E9 for ; Mon, 4 Oct 2021 14:21:35 +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=VSY1hMRN80I3ORRgiFdBbz5KuY7aO7CvwRaBTtxUTMw=; b=iSjuJsWjZwm/GbAfAVLUd8vqX1 99S6MRTSn1eLDDR1YZjvyqWicIlBIvdKUYbpAQyEeObTPQjOOwmlNktszQi7QzrHsyvY1OPDQWv6L tu+twNH+1Ff9MwZj8/RGbT/4n1vq1Zj202yebSxOgE1sA0ogIz5PjD5fVReILIZ2zX4xguiym0Xak j3bUQz7TXlajx9NCEGqMnbjI1j/xDJj0Mo8mO2U8ZTVBWTdV9I9BsfTG4fA4AwDgQLXZqAkM30TyA G1gsmSNIwTjVJjcPPSsHYE6ctbxqh9B7WBppnQa9Quqd+buGfrwsnTonJGoCG1v2ijPNc4QMRNtYv 8CP2pAmQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXOnl-00Gydh-Ha; Mon, 04 Oct 2021 14:19:20 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" Subject: [PATCH 25/62] mm/slub: Convert node_match() to take a struct slab Date: Mon, 4 Oct 2021 14:46:13 +0100 Message-Id: <20211004134650.4031813-26-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-Server: rspam03 X-Rspamd-Queue-Id: 45DF770021E9 X-Stat-Signature: egm3iddbd36szofm8q8q7zat8ec6gb1h Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=iSjuJsWj; dmarc=none; spf=none (imf02.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-HE-Tag: 1633357295-792321 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: Removes a few calls to slab_page() Signed-off-by: Matthew Wilcox (Oracle) --- mm/slub.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 827196f0aee5..e6c363d8de22 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2720,10 +2720,10 @@ static int slub_cpu_dead(unsigned int cpu) * Check if the objects in a per cpu structure fit numa * locality expectations. */ -static inline int node_match(struct page *page, int node) +static inline int node_match(struct slab *slab, int node) { #ifdef CONFIG_NUMA - if (node != NUMA_NO_NODE && page_to_nid(page) != node) + if (node != NUMA_NO_NODE && slab_nid(slab) != node) return 0; #endif return 1; @@ -2892,7 +2892,7 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, } redo: - if (unlikely(!node_match(slab_page(slab), node))) { + if (unlikely(!node_match(slab, node))) { /* * same as above but node_match() being false already * implies node != NUMA_NO_NODE @@ -3168,7 +3168,7 @@ static __always_inline void *slab_alloc_node(struct kmem_cache *s, * there is a suitable cpu freelist. */ if (IS_ENABLED(CONFIG_PREEMPT_RT) || - unlikely(!object || !slab || !node_match(slab_page(slab), node))) { + unlikely(!object || !slab || !node_match(slab, node))) { object = __slab_alloc(s, gfpflags, node, addr, c); } else { void *next_object = get_freepointer_safe(s, object);