From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8FE4EC5517A for ; Mon, 26 Oct 2020 17:34:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CC38421D42 for ; Mon, 26 Oct 2020 17:34:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CC38421D42 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B7E486B005C; Mon, 26 Oct 2020 13:34:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8D19E6B0071; Mon, 26 Oct 2020 13:34:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 768B56B006C; Mon, 26 Oct 2020 13:34:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 269926B0068 for ; Mon, 26 Oct 2020 13:34:09 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id C07D91EF1 for ; Mon, 26 Oct 2020 17:34:08 +0000 (UTC) X-FDA: 77414774976.08.men64_1a184f727275 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id A53931819E766 for ; Mon, 26 Oct 2020 17:34:08 +0000 (UTC) X-HE-Tag: men64_1a184f727275 X-Filterd-Recvd-Size: 2285 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Mon, 26 Oct 2020 17:34:08 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id A7B66ADDB; Mon, 26 Oct 2020 17:34:06 +0000 (UTC) From: Vlastimil Babka To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Alexander Potapenko , Kees Cook , Michal Hocko , David Hildenbrand , Mateusz Nosek , Vlastimil Babka Subject: [PATCH 0/3] optimize handling of memory debugging parameters Date: Mon, 26 Oct 2020 18:33:55 +0100 Message-Id: <20201026173358.14704-1-vbabka@suse.cz> X-Mailer: git-send-email 2.29.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: We currently have several kernel parameters that affect page allocator wr= t debugging and hardening, some also with config options: init_on_alloc, init_on_free, page_poison, debug_pagealloc. These options generally have their own static keys, but sometimes a decis= ion for e.g. clearing a page depends on multiple options, and the handling is= not as efficient as it could be. This series addresses that by centralizing t= he decisions into a new init_mem_debugging() function that enables individua= l static keys, and most paths now rely on a single static key check. Subtle dependency on the order of parameters is also eliminated (Patch 1). The r= esult is more efficient and hopefully also more readable code. Vlastimil Babka (3): mm, page_alloc: do not rely on the order of page_poison and init_on_alloc/free parameters mm, page_poison: use static key more efficiently mm, page_alloc: reduce static keys in prep_new_page() drivers/virtio/virtio_balloon.c | 2 +- include/linux/mm.h | 36 ++++----- init/main.c | 2 +- mm/page_alloc.c | 126 ++++++++++++++++++-------------- mm/page_poison.c | 40 ++-------- 5 files changed, 97 insertions(+), 109 deletions(-) --=20 2.29.0