From patchwork Mon Jan 24 18:02:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: andrey.konovalov@linux.dev X-Patchwork-Id: 12722752 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 33D7EC433F5 for ; Mon, 24 Jan 2022 18:35:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=R8/Un9jGlmd/K7i5pXqSQbfzsDanTyXYshWFXDik/KQ=; b=Vc3tP7CXeyW00J zPw8CqM9cze2ZJMU2pzJxA6z5KVE/x6OwwUSWnNb41PVccGvXxZUl+VU/9x7f84adE/9cc3jKyUmn D1UOTuzE5U1Bgi4++l1WSByGAZ9T0XwbV/G/Z6mOc2VlRjPw0+TMRgC0cRNtJbANefwpLDJnPPmr+ KOgnsajg1tizpCE6ueGzpV9t2SRfzVBSWfoF8t03UZg7kLhHTooNMC/dRmQvWg6BS3NZiGf+ydkpa q7S9HfrNGf/zFJXo4EhBsRh8SunyumAUbcnpyLTLY2L7g3T7zBPb0XTce0rBrNIqNmONKvByUdaN5 dti2YQn173R8T6VwhHqw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nC4AW-004Xgd-PO; Mon, 24 Jan 2022 18:34:21 +0000 Received: from out2.migadu.com ([2001:41d0:2:aacc::]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nC3gh-004M0Q-Mo for linux-arm-kernel@lists.infradead.org; Mon, 24 Jan 2022 18:03:33 +0000 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1643047409; h=from:from:reply-to:subject:subject: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=YUKFeRnU18yjbXq2i74hXRIrDf5f39WtjIbACz6CeBE=; b=J6XktU+xPXb7/hqOznPmmk8IrMciRRvAVtXW14f6Swsgih0UTMGp1eHUnK4xP7tdxr1/8d 7cTW1hdQL8U8rB0JTUKu/IdX0PZzSIhY6GeGtgUERJwVqoglZ/lPq/ux8zxCuCe1rIeLMX W5m16QZkztvby8QiMd+iT3SMJvlwk8c= From: andrey.konovalov@linux.dev To: Andrew Morton Cc: Andrey Konovalov , Marco Elver , Alexander Potapenko , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, linux-mm@kvack.org, Vincenzo Frascino , Catalin Marinas , Will Deacon , Mark Rutland , linux-arm-kernel@lists.infradead.org, Peter Collingbourne , Evgenii Stepanov , linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH v6 06/39] kasan: drop skip_kasan_poison variable in free_pages_prepare Date: Mon, 24 Jan 2022 19:02:14 +0100 Message-Id: <1d33212e79bc9ef0b4d3863f903875823e89046f.1643047180.git.andreyknvl@google.com> In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220124_100331_979874_762C51B6 X-CRM114-Status: GOOD ( 12.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Andrey Konovalov skip_kasan_poison is only used in a single place. Call should_skip_kasan_poison() directly for simplicity. Signed-off-by: Andrey Konovalov Suggested-by: Marco Elver --- Changes v1->v2: - Add this patch. --- mm/page_alloc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index f994fd68e3b1..8481420d2502 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1301,7 +1301,6 @@ static __always_inline bool free_pages_prepare(struct page *page, 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); @@ -1375,7 +1374,7 @@ static __always_inline bool free_pages_prepare(struct page *page, * 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. */