Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3541990pxb; Mon, 24 Jan 2022 11:48:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJyKwfRZkrzAjfFyVZYJ+PVAmSj85ClOnsIyHOPkddnxKvGwueQHQEa8Nmp/lb8m+HqomRxX X-Received: by 2002:a17:902:bc88:b0:149:2032:6bcf with SMTP id bb8-20020a170902bc8800b0014920326bcfmr15731712plb.44.1643053736562; Mon, 24 Jan 2022 11:48:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643053736; cv=none; d=google.com; s=arc-20160816; b=YG7V7NH2lZdsxUlyAzYkjJ4hvzW2zq172oVWNOBnL8p+Zn4z0FgJH70zC2U13eavYe ff1t1mO6cg00Bo4G6REbI4IYBbtjI0jmEovfUUmm21mkMad3hm5oiRBxrdVwTfIDMqoV AhTy39jaughWSu8g68jYSQNn5cunwbaO0or+QF8q1I9f6DatLn5h4zxVYHXQZ5MGAxH3 nGdEHxknxRDQBBjEgG4HATCf1eCAD5tcxSHBBUxq+7oKMQIEP4/uc7uMcKSoYzSwsw9h Nawwyp/npI73HXAR1mWkP9tvR9GIoTK2uEvBrP/7sve8O7MBDAdr4B3fDWIUaW9czkN9 FVDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YUKFeRnU18yjbXq2i74hXRIrDf5f39WtjIbACz6CeBE=; b=cwxXSjG0J8VGwgxJZK6CWSW7ESO1naf+rIpRlnFlVMmTygGMkw6Aa5yh9K2AjfKAEi ZGAWlx/mYebtrAOXlFlAbSRR4zPw2I2lMLH4dQFpw6qKVDnutAJsIZ8DG7zAzgUkFYj1 gfCn2VhLZt13xq6r1J0yHnGiAbhDwQM+vhNcC7NU/kW1iss9nHY9LFlGzV4nNt4LgOJM wp1z1sNCdRljnQwFiV3qmayjIAAxNxslNZ7GNwQEGVwqwGR1qc2SZjzZAkYvhm1IyMdp UKkGJjHcSfEjnIELL/FBmuaoJpFQw7LLABXOiklTW3XKGRyT3/JcO23TsDwVdssYGw6Y f7Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=J6XktU+x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y16si14387980pfl.104.2022.01.24.11.48.42; Mon, 24 Jan 2022 11:48:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=J6XktU+x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244856AbiAXSDk (ORCPT + 99 others); Mon, 24 Jan 2022 13:03:40 -0500 Received: from out2.migadu.com ([188.165.223.204]:12740 "EHLO out2.migadu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241752AbiAXSDb (ORCPT ); Mon, 24 Jan 2022 13:03:31 -0500 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 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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. */ -- 2.25.1