From patchwork Mon Oct 4 13:46:14 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: 12534107 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 379CAC433EF for ; Mon, 4 Oct 2021 14:22:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C8ABC61244 for ; Mon, 4 Oct 2021 14:22:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C8ABC61244 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 633AF940031; Mon, 4 Oct 2021 10:22:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5E2E394000B; Mon, 4 Oct 2021 10:22:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4D1B0940031; Mon, 4 Oct 2021 10:22:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0026.hostedemail.com [216.40.44.26]) by kanga.kvack.org (Postfix) with ESMTP id 3E24394000B for ; Mon, 4 Oct 2021 10:22:31 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id F238F8249980 for ; Mon, 4 Oct 2021 14:22:30 +0000 (UTC) X-FDA: 78658970460.09.B4485D8 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf21.hostedemail.com (Postfix) with ESMTP id 8677CD03827D for ; Mon, 4 Oct 2021 14:22:30 +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=wxV7xNK7tFKJ7rxuq2yiCvycho7KN/DrxkwaR/lLO2o=; b=DtbdD9Qkubcf7zcOkCZzmvfo5r fEy85NOHfSTGOuNyiFO3SOdMGrPM4qZZilMtNxJvvz1fTV2/WKalVNui3f47SnjiX7AkgycoLc8S7 27qw8wrCB7XlmjfIFmfXG3VBWXqnYzTssg1ECWzQbyWB/FwNpwPvlIQ6EO/m5t8SY+VXg7YwSpTLM O4PKoNOIFw3Gh/bSU8R43xNxoicgupmJ2qnG1wYMtUhkrngS3BAJakebGBmmJhOka6BcIJLngfoet UjcLOYU+MoiiItX6xOhMGbWJwstDvpZjIehLYN9o/RKCfrIwSKk5NAkQyuHZ/LT9YJXyqiKTx/BP8 YDyvOAZg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXOpQ-00GynN-Gy; Mon, 04 Oct 2021 14:20:46 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" Subject: [PATCH 26/62] mm/slub: Convert slab flushing to struct slab Date: Mon, 4 Oct 2021 14:46:14 +0100 Message-Id: <20211004134650.4031813-27-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 Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=DtbdD9Qk; spf=none (imf21.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: rspam04 X-Rspamd-Queue-Id: 8677CD03827D X-Stat-Signature: ewtmxtfojnk17m9bid3daafemdh6bto8 X-HE-Tag: 1633357350-422016 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: Moves a few calls to slab_page() around. Gets us a step closer to allowing deactivate_slab() to take a slab instead of a page. Signed-off-by: Matthew Wilcox (Oracle) --- mm/slub.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index e6c363d8de22..f33a196fe64f 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2588,12 +2588,12 @@ static inline void unfreeze_partials_cpu(struct kmem_cache *s, static inline void flush_slab(struct kmem_cache *s, struct kmem_cache_cpu *c) { unsigned long flags; - struct page *page; + struct slab *slab; void *freelist; local_lock_irqsave(&s->cpu_slab->lock, flags); - page = slab_page(c->slab); + slab = c->slab; freelist = c->freelist; c->slab = NULL; @@ -2602,8 +2602,8 @@ static inline void flush_slab(struct kmem_cache *s, struct kmem_cache_cpu *c) local_unlock_irqrestore(&s->cpu_slab->lock, flags); - if (page) { - deactivate_slab(s, page, freelist); + if (slab) { + deactivate_slab(s, slab_page(slab), freelist); stat(s, CPUSLAB_FLUSH); } } @@ -2612,14 +2612,14 @@ static inline void __flush_cpu_slab(struct kmem_cache *s, int cpu) { struct kmem_cache_cpu *c = per_cpu_ptr(s->cpu_slab, cpu); void *freelist = c->freelist; - struct page *page = slab_page(c->slab); + struct slab *slab = c->slab; c->slab = NULL; c->freelist = NULL; c->tid = next_tid(c->tid); - if (page) { - deactivate_slab(s, page, freelist); + if (slab) { + deactivate_slab(s, slab_page(slab), freelist); stat(s, CPUSLAB_FLUSH); }