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 0AAA5C4363A for ; Mon, 26 Oct 2020 17:34:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BC98C2225C for ; Mon, 26 Oct 2020 17:34:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1780200AbgJZReI (ORCPT ); Mon, 26 Oct 2020 13:34:08 -0400 Received: from mx2.suse.de ([195.135.220.15]:43870 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1780080AbgJZReH (ORCPT ); Mon, 26 Oct 2020 13:34:07 -0400 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: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We currently have several kernel parameters that affect page allocator wrt 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 decision 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 the decisions into a new init_mem_debugging() function that enables individual 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 result 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(-) -- 2.29.0