From patchwork Mon Oct 4 13:46:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12534205 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 41990C433F5 for ; Mon, 4 Oct 2021 14:48:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E46A3613AD for ; Mon, 4 Oct 2021 14:48:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E46A3613AD 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 885DC94004B; Mon, 4 Oct 2021 10:48:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 835D494000B; Mon, 4 Oct 2021 10:48:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6FDF394004B; Mon, 4 Oct 2021 10:48:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0235.hostedemail.com [216.40.44.235]) by kanga.kvack.org (Postfix) with ESMTP id 617AB94000B for ; Mon, 4 Oct 2021 10:48:11 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 1B7CC1828DEBC for ; Mon, 4 Oct 2021 14:48:11 +0000 (UTC) X-FDA: 78659035182.24.40665ED Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf11.hostedemail.com (Postfix) with ESMTP id C4B21F000BD0 for ; Mon, 4 Oct 2021 14:48:10 +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=ofGLTMpoQ5pBF8mYfiYstuiwmeeCrHVfwPHbw1ktlMs=; b=IhJasQ0w8FtV+dUNWEYQBwn0n9 65dZl96si4RKU8obFdkhdpAaHvktjy4WJJwqSq7YaCqkF6JreIIRVhENPYiUNZfvF4CnI+Q5C6IRw Rp4hfOGYxfjVZxWbhlvZ+uHDRJLngS6wein8ky9MJnfi8OXu4/Pja4YAgC123ROFyxSGzQD6bAkv3 ZyvT1kBiYLBP5Q02tuQcc4ZAOxkb4FGNS9Ms21lImyMRf4NIN+5yCBMv2ptuM+3vZn6q60keb6TEI s8FSnPAWLsWmn+lAPKasactlSZAbQwZxv7QVUMbrKQL6rNXYeKz/frH5e5LZgZpMRZoqSbv5iSXn3 lNFX/zWg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXPF3-00H1EC-Ny; Mon, 04 Oct 2021 14:47:06 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" Subject: [PATCH 47/62] mm/slub: Convert trace() to take a struct slab Date: Mon, 4 Oct 2021 14:46:35 +0100 Message-Id: <20211004134650.4031813-48-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: C4B21F000BD0 X-Stat-Signature: 7bsctunejh3z1z91jikb78dmjx8zegmt Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=IhJasQ0w; spf=none (imf11.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: 1633358890-700009 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: Improves type safety and removes calls to slab_page(). Signed-off-by: Matthew Wilcox (Oracle) --- mm/slub.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index d941bd188a8e..72a50fab64b5 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1165,15 +1165,15 @@ static int on_freelist(struct kmem_cache *s, struct slab *slab, void *search) return search == NULL; } -static void trace(struct kmem_cache *s, struct page *page, void *object, +static void trace(struct kmem_cache *s, struct slab *slab, void *object, int alloc) { if (s->flags & SLAB_TRACE) { pr_info("TRACE %s %s 0x%p inuse=%d fp=0x%p\n", s->name, alloc ? "alloc" : "free", - object, page->inuse, - page->freelist); + object, slab->inuse, + slab->freelist); if (!alloc) print_section(KERN_INFO, "Object ", (void *)object, @@ -1291,7 +1291,7 @@ static noinline int alloc_debug_processing(struct kmem_cache *s, /* Success perform special debug activities for allocs */ if (s->flags & SLAB_STORE_USER) set_track(s, object, TRACK_ALLOC, addr); - trace(s, slab_page(slab), object, 1); + trace(s, slab, object, 1); init_object(s, object, SLUB_RED_ACTIVE); return 1; @@ -1370,7 +1370,7 @@ static noinline int free_debug_processing( if (s->flags & SLAB_STORE_USER) set_track(s, object, TRACK_FREE, addr); - trace(s, slab_page(slab), object, 0); + trace(s, slab, object, 0); /* Freepointer not overwritten by init_object(), SLAB_POISON moved it */ init_object(s, object, SLUB_RED_INACTIVE);