From patchwork Wed Dec 1 18:14:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlastimil Babka X-Patchwork-Id: 12650699 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 B2EF3C433F5 for ; Wed, 1 Dec 2021 18:20:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C03226B007E; Wed, 1 Dec 2021 13:15:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 78DA66B0092; Wed, 1 Dec 2021 13:15:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4C5146B0089; Wed, 1 Dec 2021 13:15:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0019.hostedemail.com [216.40.44.19]) by kanga.kvack.org (Postfix) with ESMTP id 1935D6B007D for ; Wed, 1 Dec 2021 13:15:29 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id CD2FE8249980 for ; Wed, 1 Dec 2021 18:15:18 +0000 (UTC) X-FDA: 78870027516.30.B82A47B Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf11.hostedemail.com (Postfix) with ESMTP id 78344F0000A8 for ; Wed, 1 Dec 2021 18:15:18 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 69EBC1FD61; Wed, 1 Dec 2021 18:15:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1638382517; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/cffam0/Cfj2BjqtfHUS37XDsk9qpJ6fpIcasEIOlOM=; b=vAdJ7CrLNQCAyGakq6MmL4aJyPLU3LWPynC1MPk+hokgMt6mCr/khyUzvEDC0cN1YVhVds v9t7NEVPH5dQLlYcSSplsltMPGJzikA321h691UgKlLcI7OIOplqJZTRlYqqB0riocCXiZ 92+rOfz0X0Gz30TwzgRnNxT8NgdgwZ4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1638382517; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/cffam0/Cfj2BjqtfHUS37XDsk9qpJ6fpIcasEIOlOM=; b=VLOpm+QQrtYvMH1+IcpCbmlynCkqJFHTjdHY1YfGwpt4PR85MIX6aOl8RyMDv9eMM/7ku5 8yvqfzqYL1MrXADw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4140D14050; Wed, 1 Dec 2021 18:15:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id APojD7W7p2HPSAAAMHmgww (envelope-from ); Wed, 01 Dec 2021 18:15:17 +0000 From: Vlastimil Babka To: Matthew Wilcox , Christoph Lameter , David Rientjes , Joonsoo Kim , Pekka Enberg Cc: linux-mm@kvack.org, Andrew Morton , patches@lists.linux.dev, Vlastimil Babka Subject: [PATCH v2 13/33] mm/slub: Convert print_page_info() to print_slab_info() Date: Wed, 1 Dec 2021 19:14:50 +0100 Message-Id: <20211201181510.18784-14-vbabka@suse.cz> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211201181510.18784-1-vbabka@suse.cz> References: <20211201181510.18784-1-vbabka@suse.cz> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1796; i=vbabka@suse.cz; h=from:subject; bh=dM/j4MeUN9tPniCbCQTnqAsDsmqb9dlfi/A8pky4VTU=; b=owEBbQGS/pANAwAIAeAhynPxiakQAcsmYgBhp7t6KcMe9afXi227VqxahdBawf4y5PTEl1vI3hzA sYL2nPmJATMEAAEIAB0WIQSNS5MBqTXjGL5IXszgIcpz8YmpEAUCYae7egAKCRDgIcpz8YmpEBVdCA CogvL1qPclYG/vdsBuwvdblTSaqgaJFEpwg+Pvq3kCCwqqBrG+n3S3aqvXK6wpeXSYE/Cz1QYfiPtl HJvvac/ueWVZN0ByifWamQrpEkuLU/kQvabWu2zMWI4XnY0cVy/rdycgGhpglGovC7gueESc0IdTZh 7sq6xZ6I6qJeqfP8T28vRQuaZurqGZyLDVzIE875aWim2sJ8SBZfnRqAOTxFMzU9YCdp3LupWnI3oH 1qj1i4iKYPpLtROHx2fnpsn0wgQugyyJ5zCBIHoRjDDpb4C3Z2G4ZlmTK+bvnNPE07we6gmG4rlwV0 b4wi7zJ4828Hc0Bfu7ugM7JQJlOfi4 X-Developer-Key: i=vbabka@suse.cz; a=openpgp; fpr=A940D434992C2E8E99103D50224FA7E7CC82A664 X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 78344F0000A8 Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=vAdJ7CrL; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=VLOpm+QQ; dmarc=none; spf=pass (imf11.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Stat-Signature: 6xmckf65n4j6jy19a8y7jh586z7q6pbf X-HE-Tag: 1638382518-701651 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: From: "Matthew Wilcox (Oracle)" Improve the type safety and prepare for further conversion. For flags access, convert to folio internally. [ vbabka@suse.cz: access flags via folio_flags() ] Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Vlastimil Babka --- mm/slub.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 2cbd2403005f..a4f7dafe0610 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -788,12 +788,13 @@ void print_tracking(struct kmem_cache *s, void *object) print_track("Freed", get_track(s, object, TRACK_FREE), pr_time); } -static void print_page_info(struct page *page) +static void print_slab_info(const struct slab *slab) { - pr_err("Slab 0x%p objects=%u used=%u fp=0x%p flags=%pGp\n", - page, page->objects, page->inuse, page->freelist, - &page->flags); + struct folio *folio = (struct folio *)slab_folio(slab); + pr_err("Slab 0x%p objects=%u used=%u fp=0x%p flags=%pGp\n", + slab, slab->objects, slab->inuse, slab->freelist, + folio_flags(folio, 0)); } static void slab_bug(struct kmem_cache *s, char *fmt, ...) @@ -833,7 +834,7 @@ static void print_trailer(struct kmem_cache *s, struct page *page, u8 *p) print_tracking(s, p); - print_page_info(page); + print_slab_info(page_slab(page)); pr_err("Object 0x%p @offset=%tu fp=0x%p\n\n", p, p - addr, get_freepointer(s, p)); @@ -903,7 +904,7 @@ static __printf(3, 4) void slab_err(struct kmem_cache *s, struct page *page, vsnprintf(buf, sizeof(buf), fmt, args); va_end(args); slab_bug(s, "%s", buf); - print_page_info(page); + print_slab_info(page_slab(page)); dump_stack(); add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE); }