From patchwork Mon Oct 4 13:46:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12534199 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 CB9F9C433F5 for ; Mon, 4 Oct 2021 14:45:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 75FE26139F for ; Mon, 4 Oct 2021 14:45:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 75FE26139F 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 11037940048; Mon, 4 Oct 2021 10:45:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0C10994000B; Mon, 4 Oct 2021 10:45:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EF131940048; Mon, 4 Oct 2021 10:45:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0211.hostedemail.com [216.40.44.211]) by kanga.kvack.org (Postfix) with ESMTP id E1FF594000B for ; Mon, 4 Oct 2021 10:45:14 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id A29462FD73 for ; Mon, 4 Oct 2021 14:45:14 +0000 (UTC) X-FDA: 78659027748.25.A6DB2B1 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf03.hostedemail.com (Postfix) with ESMTP id 5F3C430007BF for ; Mon, 4 Oct 2021 14:45:14 +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=aEqZaX/FloNxnWiS4pxgrSMgWV8aLzwHmaFIHzXHqPI=; b=AxGltJEjI8FiRRLwxNF825E5j4 AKGVoe83xgUlEUTbbtOOQnXfDlh43Ckfa6xmpu1KdbjWQJPOpOxqqhAk/V0fMN/F9wQQT2kgn0kuh PPpWOLc5trZJltE+1mNsa7eeQuzm4cV9jAI6rcDpOGrJz0Kh8Q8Arkl1y58HkXwL3L0x42cpOXiSr zqSdtDF1djk8DOIaTFdFf03AfXnuldw7Z41WSEJqw0xdBFc1aAww11STgEM/hohAsFDPjfzK+wmGu dmVpdUzg17rmy05/cGmLiYK4wSRn1G6vW2rhl6t9tbtoYNQKc7FFNGbFfZ9KLm1F3QcN12rVfPdaM ultc6bnw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXPBJ-00H0zR-Pm; Mon, 04 Oct 2021 14:43:48 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" Subject: [PATCH 44/62] mm/slub: Convert print_trailer() to struct slab Date: Mon, 4 Oct 2021 14:46:32 +0100 Message-Id: <20211004134650.4031813-45-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: 5F3C430007BF X-Stat-Signature: zedc4eqb8mzkyy7whssnaw6er9hajkyq Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=AxGltJEj; spf=none (imf03.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: 1633358714-459306 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: This is mostly pushing slab_page() calls down. 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 a93a6d679de2..9651586a3450 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -816,14 +816,14 @@ static bool freelist_corrupted(struct kmem_cache *s, struct slab *slab, return false; } -static void print_trailer(struct kmem_cache *s, struct page *page, u8 *p) +static void print_trailer(struct kmem_cache *s, struct slab *slab, u8 *p) { unsigned int off; /* Offset of last byte */ - u8 *addr = page_address(page); + u8 *addr = slab_address(slab); print_tracking(s, p); - print_page_info(page); + print_page_info(slab_page(slab)); pr_err("Object 0x%p @offset=%tu fp=0x%p\n\n", p, p - addr, get_freepointer(s, p)); @@ -862,7 +862,7 @@ static void object_err(struct kmem_cache *s, struct slab *slab, return; slab_bug(s, "%s", reason); - print_trailer(s, slab_page(slab), object); + print_trailer(s, slab, object); add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE); } @@ -932,7 +932,7 @@ static int check_bytes_and_report(struct kmem_cache *s, struct slab *slab, pr_err("0x%p-0x%p @offset=%tu. First byte 0x%x instead of 0x%x\n", fault, end - 1, fault - addr, fault[0], value); - print_trailer(s, slab_page(slab), object); + print_trailer(s, slab, object); add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE); skip_bug_print: