From patchwork Fri Mar 25 01:10:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12791135 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 28E7CC433F5 for ; Fri, 25 Mar 2022 01:10:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BC9A08D0002; Thu, 24 Mar 2022 21:10:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B78836B0075; Thu, 24 Mar 2022 21:10:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A67CD8D0002; Thu, 24 Mar 2022 21:10:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id 963716B0073 for ; Thu, 24 Mar 2022 21:10:23 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 6DFF7802AA for ; Fri, 25 Mar 2022 01:10:23 +0000 (UTC) X-FDA: 79281127926.14.DF465D7 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf24.hostedemail.com (Postfix) with ESMTP id D9DBE18002E for ; Fri, 25 Mar 2022 01:10:22 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 80444B82709; Fri, 25 Mar 2022 01:10:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F52EC340EE; Fri, 25 Mar 2022 01:10:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1648170620; bh=0ozVZdAkM6Z0SH/KwNttsxWwDvJtChog2DebmLF4+Yg=; h=Date:To:From:In-Reply-To:Subject:From; b=NYLwQ2+49nAnS3EhY/MlH1Qc74uHt4mtfl2eeTR4M9a4QRwYtoSAP97MIuQ0vauSD 5heQdZPRp9rDso9zUxMgxck9RwzTItp4AiRmgWkc6pFDKIAYoMDdnIATyJsUY/bpQu HY+sLm/GneY6/cQe7DfH27dUE6fnYBrmrFO6fkUI= Date: Thu, 24 Mar 2022 18:10:19 -0700 To: will@kernel.org,vincenzo.frascino@arm.com,ryabinin.a.a@gmail.com,pcc@google.com,mark.rutland@arm.com,glider@google.com,eugenis@google.com,elver@google.com,dvyukov@google.com,catalin.marinas@arm.com,andreyknvl@google.com,akpm@linux-foundation.org,patches@lists.linux.dev,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220324180758.96b1ac7e17675d6bc474485e@linux-foundation.org> Subject: [patch 035/114] kasan: drop skip_kasan_poison variable in free_pages_prepare Message-Id: <20220325011020.1F52EC340EE@smtp.kernel.org> X-Rspam-User: X-Stat-Signature: a9sr8m9b1xpc8gi99tkzfd6nohr5gtx1 Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=NYLwQ2+4; spf=pass (imf24.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: D9DBE18002E X-HE-Tag: 1648170622-146454 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: Andrey Konovalov Subject: kasan: drop skip_kasan_poison variable in free_pages_prepare skip_kasan_poison is only used in a single place. Call should_skip_kasan_poison() directly for simplicity. Link: https://lkml.kernel.org/r/1d33212e79bc9ef0b4d3863f903875823e89046f.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Suggested-by: Marco Elver Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton --- mm/page_alloc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/mm/page_alloc.c~kasan-drop-skip_kasan_poison-variable-in-free_pages_prepare +++ a/mm/page_alloc.c @@ -1297,7 +1297,6 @@ static __always_inline bool free_pages_p unsigned int order, bool check_free, fpi_t fpi_flags) { int bad = 0; - bool skip_kasan_poison = should_skip_kasan_poison(page, fpi_flags); bool init = want_init_on_free(); VM_BUG_ON_PAGE(PageTail(page), page); @@ -1371,7 +1370,7 @@ static __always_inline bool free_pages_p * With hardware tag-based KASAN, memory tags must be set before the * page becomes unavailable via debug_pagealloc or arch_free_page. */ - if (!skip_kasan_poison) { + if (!should_skip_kasan_poison(page, fpi_flags)) { kasan_poison_pages(page, order, init); /* Memory is already initialized if KASAN did it internally. */