From patchwork Thu Jul 11 16:35:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlastimil Babka X-Patchwork-Id: 13730860 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 18E82C3DA49 for ; Thu, 11 Jul 2024 16:35:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7A9966B0095; Thu, 11 Jul 2024 12:35:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 760436B0093; Thu, 11 Jul 2024 12:35:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 473936B0095; Thu, 11 Jul 2024 12:35:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 26DA16B0093 for ; Thu, 11 Jul 2024 12:35:52 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id D522FA0773 for ; Thu, 11 Jul 2024 16:35:51 +0000 (UTC) X-FDA: 82328023302.28.540E932 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf11.hostedemail.com (Postfix) with ESMTP id 8341C40007 for ; Thu, 11 Jul 2024 16:35:49 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=tRudBEpm; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=yuI+Sj6f; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=tRudBEpm; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=yuI+Sj6f; spf=pass (imf11.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1720715717; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=nlW4wvqPrPuw3LFNzjQ8J1N+uWec7sUMrxbYGJfRp84=; b=ysSd7gFsu/FMshImKggbwe+Frj+zHylnRfOsIt725+F+/9D5yfp0Wb29FJ76CnL1uzajJR 2q1sINquqvTKxKsqYOnOh1jm8ADewXR1tabNt30BSE6Vo+Vy7KUL1KEALGje7YsYI34GTj AmAvPQWP7pi9ecvhsP+0YFaJHlDYugs= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1720715717; a=rsa-sha256; cv=none; b=R3dCT7UCNdQv+aP8L62J44pduE59X9k7aKUa95T/BYKpoeGGMxjyzcv736uzNO9ps+8osR yM51oCPDfdZFHCus3TT3UhahOMf0pYE1Narz4yWwcvVccC4WriaJsN2ZBaGhbRDINjwfqD ctqn04UjZiYx05iQbQPVQ7ePKeMXQ2Q= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=tRudBEpm; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=yuI+Sj6f; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=tRudBEpm; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=yuI+Sj6f; spf=pass (imf11.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 8CD6021BD4; Thu, 11 Jul 2024 16:35:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1720715747; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nlW4wvqPrPuw3LFNzjQ8J1N+uWec7sUMrxbYGJfRp84=; b=tRudBEpm0/hJNAikX4ahQGKuwAtwM59s/n3MZy3Wu1xuH7oAvEte8M2IA9V/FPykfWbxzp 5A7H/OoGYzIEQXwyz9GD7RuNzM/t8yrrUT5vnFTD7gVlGw5XQ6konEGYoYYSyKAIuHZfpP NKmweaUKNHawjrtyIainEQld+0CI0tg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1720715747; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nlW4wvqPrPuw3LFNzjQ8J1N+uWec7sUMrxbYGJfRp84=; b=yuI+Sj6f7t8DstG8fIngBUEeqiE/b9S7WFrkHowZpq4/01YI3Skir2zfCNT/Z9vA2N79sX uTOtDxkWSDHawJCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1720715747; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nlW4wvqPrPuw3LFNzjQ8J1N+uWec7sUMrxbYGJfRp84=; b=tRudBEpm0/hJNAikX4ahQGKuwAtwM59s/n3MZy3Wu1xuH7oAvEte8M2IA9V/FPykfWbxzp 5A7H/OoGYzIEQXwyz9GD7RuNzM/t8yrrUT5vnFTD7gVlGw5XQ6konEGYoYYSyKAIuHZfpP NKmweaUKNHawjrtyIainEQld+0CI0tg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1720715747; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nlW4wvqPrPuw3LFNzjQ8J1N+uWec7sUMrxbYGJfRp84=; b=yuI+Sj6f7t8DstG8fIngBUEeqiE/b9S7WFrkHowZpq4/01YI3Skir2zfCNT/Z9vA2N79sX uTOtDxkWSDHawJCQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 63CBB136AF; Thu, 11 Jul 2024 16:35:47 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id qVbHF+MJkGa0NwAAD6G6ig (envelope-from ); Thu, 11 Jul 2024 16:35:47 +0000 From: Vlastimil Babka Subject: [PATCH 0/2] revert unconditional slab and page allocator fault injection calls Date: Thu, 11 Jul 2024 18:35:29 +0200 Message-Id: <20240711-b4-fault-injection-reverts-v1-0-9e2651945d68@suse.cz> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIANIJkGYC/x2MzQqDMBAGX0X27EISYou+injw50u7pURJYhHEd 3fpcWBmTspIgkxddVLCT7KsUcHWFc3vMb7AsiiTM86bp7U8eQ7j/i0s8YO5qM7aIZXM8ItpWzy cCQ3pYEsIcvzn/XBdN7ldItxsAAAA To: Andrew Morton Cc: Mateusz Guzik , Akinobu Mita , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Christoph Lameter , David Rientjes , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-mm@kvack.org, Vlastimil Babka X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1987; i=vbabka@suse.cz; h=from:subject:message-id; bh=WuuKCyDw0yQFRmVX+tagmwlSGJzk5TMRGPBwaeHhQKY=; b=owEBbQGS/pANAwAIAbvgsHXSRYiaAcsmYgBmkAnazeXPb+JooODfX5LqRxRE14MV4gsWNWzrc XZaraZTQ26JATMEAAEIAB0WIQR7u8hBFZkjSJZITfG74LB10kWImgUCZpAJ2gAKCRC74LB10kWI mmC3B/9qaYKMzEKQ94Ky/6rRRigMSfXfhKTjrCG5SiXZcEn1l0dIkbTOgpSuzczRyjaPoWmUvqv 3SHrVsqsL+Q4FCJXQdoxNShSlnFUEQ6E3OGrdh0tZ8699tFIWEIbBZDWmuwC19VhNXz9b6ZIY1v ab7u7CJ4IjusmXbs0Ag3ezyOuHlYFouUS1RoXnu8tUjF/zbPXq5YpmHKdo67FDy+PLeYtT0pXtm Y7l3NraB5T3zlq3HIib2EvSEUeFxDOUrUS69O/KpiwL4EbBhyfdruY0pzvK01mLcRrGIYTTTvmO Cm2F/b4/6bWuQRaa7hTu8bLrw/gQ4U4kyta7H8wLAFoNQU7x X-Developer-Key: i=vbabka@suse.cz; a=openpgp; fpr=A940D434992C2E8E99103D50224FA7E7CC82A664 X-Rspamd-Queue-Id: 8341C40007 X-Stat-Signature: 9ocg3tz9db9uomke5b9pjo8kgrzemrfi X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1720715749-426873 X-HE-Meta: U2FsdGVkX1/luaw/3ms9tZN6eR7ZWscSREg9rRjuRzo5t/04qcCRc+bshg0oz1woX5BjHoMdw+Bepx4HTpnn85AsX4+7un9WHdnt65JxWJTpOKgcNeTlmlBfUkytRiabyejsFRbI532d4ptbA9EabDd4Y8LpolQ1AjCCz0jNtDKoIqbTvr0BFL2/c3OgW6Tr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K9uJUGjKERjB6nae6I2phj+2rCjAgJkVKTYEXP2w/8SJxB2fOhbDZwn4242chhWqAaC1HPQu4Z4P7/UYb5E4iGt9v X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: These two patches largely revert commits that added function call overhead into slab and page allocation hotpaths and that cannot be currently disabled even though related CONFIG_ options do exist. A much more involved solution that can keep the callsites always existing but hidden behind a static key if unused, is possible [1] and can be pursued by anyone who believes it's necessary. Meanwhile the fact the should_failslab() error injection is already not functional on kernels built with current gcc without anyone noticing [2], and lukewarm response to [1] suggests the need is not there. I believe it will be more fair to have the state after this series as a baseline for possible further optimisation, instead of the unconditional overhead. For example a possible compromise for anyone who's fine with an empty function call overhead but not the full CONFIG_FAILSLAB / CONFIG_FAIL_PAGE_ALLOC overhead is to reuse patch 1 from [1] but insert a static key check only inside should_failslab() and should_fail_alloc_page() before performing the more expensive checks. [1] https://lore.kernel.org/all/20240620-fault-injection-statickeys-v2-0-e23947d3d84b@suse.cz/#t [2] https://github.com/bpftrace/bpftrace/issues/3258 Signed-off-by: Vlastimil Babka --- Vlastimil Babka (2): mm, slab: put should_failslab() back behind CONFIG_SHOULD_FAILSLAB mm, page_alloc: put should_fail_alloc_page() back behing CONFIG_FAIL_PAGE_ALLOC include/linux/fault-inject.h | 11 ++++------- kernel/bpf/verifier.c | 4 ++++ mm/fail_page_alloc.c | 4 +++- mm/failslab.c | 14 ++++++++------ mm/page_alloc.c | 6 ------ mm/slub.c | 8 -------- 6 files changed, 19 insertions(+), 28 deletions(-) --- base-commit: 256abd8e550ce977b728be79a74e1729438b4948 change-id: 20240711-b4-fault-injection-reverts-e4d099e620f5 Best regards,