Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp613221lqj; Sun, 2 Jun 2024 13:47:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU6eDz03yqcmL4Uc3WuTV18wPgU6Qr7RjGek5r1V0d9WgEir8ahaMvTdXwcmJjjRvzeNUzgil2PRHT+lgEHB4om+kk7v/eBRx0PKGzrKg== X-Google-Smtp-Source: AGHT+IHAmDGNDJYCuoEp8dxPMgqK7O3W2hZsbt0QJTln/AgN99CDVihPbGVFWPu7ryrsfddle4h7 X-Received: by 2002:a67:f483:0:b0:47b:cd96:6d3d with SMTP id ada2fe7eead31-48bc20a332dmr6851921137.3.1717361277058; Sun, 02 Jun 2024 13:47:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717361277; cv=pass; d=google.com; s=arc-20160816; b=zPHykDKP3nMKtOoa46kWyf1UbO7SRXfRo9noaeCuhCQ49M89UzD00Jg2vGakfDLtOC NV0Yu4l988ZwqXxPU6ttAeAKhXS95xESzPYL+xHssfpDazCiXdyIs31nFP2pn0vctP5J d8/Kk/ThTHIgud/3Kfaw+ty/rARTYVpEDbxa3Nt1R9dHUzYIwK/jOP179xxEbXgcyP1i fphnZ3zwoMgqcXMfHndZxCRyikx+m9bwrF02yfUp9eZ6M2vTUO/QumqQvvYl2AZB9laL HjUtnEGwHQshMyEK+TDOliAXzn6RR/Yi7oCIUjkg4rYSr50AKJqzMZZD0FAeyyR2zx+a +ZXw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:message-id:in-reply-to:subject:cc:to:from :date:dkim-signature; bh=faX60ecICkYxHjtv7PonXRM66RWfo/WBRMB+odShUo8=; fh=D1f+QCSOJhDli+clL62U7lp+ZVFOGbLIGMwrbiXOLGA=; b=0sriN7o2dnunrCDT2CVQPcdqJK1RDtfkL/b/N/ZcKKOh+stsix3EMNAafOj+X1/1sA 6U8YAy6/yMJnZcpiguqQuUC0pVoYpZ8lKGl9Z1AqPVt3gctnzADjIsK7lDv5NeTsENpf 6vDlXCE7NO5J+4wB0JPk4xRfy1sRAEJUOdjk4LFFqJn/6i1T5BtFvoePQ87q9TATSFs7 dp9HzhJQu3GEBTI8T2borGEICFIRDgv3JYO9NJrKBNW4714QorZzbADdAAt0MShx04Wy ZrFq3l0qYvC7gMPL+1ZQUvCudlb1Ce6Pq3w+VFAkuBq1Hlwn2cdGNjYBW6hMWIHQ6c6U liaQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=YWjQ9pVN; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-198436-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198436-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-794f32a5ce9si684461485a.581.2024.06.02.13.47.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 13:47:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198436-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=YWjQ9pVN; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-198436-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198436-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 079AB1C203B3 for ; Sun, 2 Jun 2024 20:47:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E382178283; Sun, 2 Jun 2024 20:47:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="YWjQ9pVN" Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A22CD20DF7 for ; Sun, 2 Jun 2024 20:47:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717361258; cv=none; b=EKWRfjbasMZdVszEw5+8Bl4ZiMVMWsJVCQFB1GNTR/uJsbRqWmm8rGP5hQYwxGk6UeO83iA0l7tWaIGbB+m+1fqJ7jKVg7Q5MNnquw3j5tqVfnQPVSIVr/5LTEwvONONpGEee1pQLmDh8pfxYePgQB3JNOdIpIcAfSOAJBlp7Gs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717361258; c=relaxed/simple; bh=zGxnj9cPkR7CN59vRwgIWsvFPmeqrcWRYugiGmLy2Fw=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=X6+h5utgP3s+SVE3ivRDaJwknknu65DsrqBCu+lk+ovOOqMhe8PwZ+DVPhAOzxog8qFhpEkQW3y4zFSmU/SlDQBmNNyIg6+NXT1OqYKle4QfJtwTuWLApnkpYbR86e6nRqQN5V8YVZ6+02uKB8/l2JIwY9wjy6HDabm7xRBiFs4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=YWjQ9pVN; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1f61742a024so192525ad.0 for ; Sun, 02 Jun 2024 13:47:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717361256; x=1717966056; darn=vger.kernel.org; h=content-id:mime-version:references:message-id:in-reply-to:subject :cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=faX60ecICkYxHjtv7PonXRM66RWfo/WBRMB+odShUo8=; b=YWjQ9pVN02mN/Zp9lXwTs9wKyQ+MRUlBdtUe/T4NBsyCW2MIt2YC806/nsL0uqzMER 34S9/F2pO3PHw5ptJ6+ghRdy9wJ1mmUCGI9RLkzoBj2f9vZ9TOLoaY86aVEIwQP/fKK2 cxt0L9GLWOov8zjyb1ZXY9ZEOkuhoHrggUasv+zcUjotPOzkqHumN1eu5k+6hkVsJaZ1 P5xrKi48SG53xSafoA+V60P9BIOd1WWBwF1WgwD4YuFCsccXPEu+GWEmftCDKkDxJLv5 8mcWIXXTfZuL+J/VwQhWbxe+7fdXcBG1qq9r3ieJJs7Bl+WhHcocE9IZ24goqCzoq6Dt iOAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717361256; x=1717966056; h=content-id:mime-version:references:message-id:in-reply-to:subject :cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=faX60ecICkYxHjtv7PonXRM66RWfo/WBRMB+odShUo8=; b=r8tQ7K0NyBnKgoEAmN+InfoYmDcP7YdwrzIvpHHuYtiMJH/vY5EHFlXvi2LpwlNwU5 zPbwpz4UHMxIjiPdVyoSwQlT9yqzsqaxAHPpQ8uVOGTn1DF12qpkmtanCGKb4j/+GLQm NpsfarRR2/Gzr3f1YNJf8MLxP3gQzOHswhLMwk+yvWHnFRQgFlv63K8g30svNJQmGAaM pBmhH4OFWXDp+QAEvt8uyX2M4TOWSn8QVZPv5XdCI4bY/DMcj/tVrVY8NIBH3hJRONem 0UlQI5GB5x1bFQibGexak66HPvfD6U9qyHlXlDS+kXQ1xNusTDGKfi4stmPtJJ5p0IbT /ZLA== X-Forwarded-Encrypted: i=1; AJvYcCUs7fWUibAAAZ4z8qEmjx0vAWo6qY5uVz+TLNJlxHsg8n8Sx5MjWJqBMe0oGBsTbR8m0ItQH1NrwY0r21ni41xk6+nD/1CrlsYLBhw9 X-Gm-Message-State: AOJu0YxJvyDGuzth7FOoKrpAY1nQ6fUlpSCiKYZr8Wf1NGpCS3G6CmX8 2kBHz0PmY9tSB18vmkzqkiXT7vn7uji3JaccUpHdRcSMQCTqLd9n5ZDLQMZTLw== X-Received: by 2002:a17:902:d2ca:b0:1f6:7fce:5684 with SMTP id d9443c01a7336-1f67fce5889mr178905ad.3.1717361255487; Sun, 02 Jun 2024 13:47:35 -0700 (PDT) Received: from [2620:0:1008:15:abfd:526b:c7dd:75a1] ([2620:0:1008:15:abfd:526b:c7dd:75a1]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f6324032f9sm51317705ad.242.2024.06.02.13.47.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 13:47:34 -0700 (PDT) Date: Sun, 2 Jun 2024 13:47:34 -0700 (PDT) From: David Rientjes To: Vlastimil Babka cc: Akinobu Mita , Christoph Lameter , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , "Naveen N. Rao" , Anil S Keshavamurthy , "David S. Miller" , Masami Hiramatsu , Steven Rostedt , Mark Rutland , Jiri Olsa , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, linux-kernel@vger.kernel.org, linux-mm@kvack.org, bpf@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: Re: [PATCH RFC 0/4] static key support for error injection functions In-Reply-To: <20240531-fault-injection-statickeys-v1-0-a513fd0a9614@suse.cz> Message-ID: <71ebaa45-dbd0-b39d-4b33-88da3f497297@google.com> References: <20240531-fault-injection-statickeys-v1-0-a513fd0a9614@suse.cz> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="2003064516-301007669-1717361061=:1421375" Content-ID: <32fac6fa-e3d4-f025-6ec2-7b80eb8e0bc1@google.com> This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --2003064516-301007669-1717361061=:1421375 Content-Type: text/plain; CHARSET=UTF-8 Content-Transfer-Encoding: 8BIT Content-ID: <985832d3-71c9-2701-ec5d-29c3bfccabf1@google.com> On Fri, 31 May 2024, Vlastimil Babka wrote: > Patches 3 and 4 implement the static keys for the two mm fault injection > sites in slab and page allocators. For a quick demonstration I've run a > VM and the simple test from [1] that stresses the slab allocator and got > this time before the series: > > real 0m8.349s > user 0m0.694s > sys 0m7.648s > > with perf showing > > 0.61% nonexistent [kernel.kallsyms] [k] should_failslab.constprop.0 > 0.00% nonexistent [kernel.kallsyms] [k] should_fail_alloc_page ▒ > > And after the series > > real 0m7.924s > user 0m0.727s > sys 0m7.191s > > and the functions gone from perf report. > Impressive results that will no doubt be a win for kernels that enable these options. Both CONFIG_FAILSLAB and CONFIG_FAIL_PAGE_ALLOC go out of their way to have no overhead, both in performance and kernel text overhead, when the .config options are disabled. Do we have any insight into the distros or users that enable either of these options and are expecting optimal performance? I would have assumed that while CONFIG_FAULT_INJECTION may be enabled that any users who would care deeply about this would have disabled both of these debug options. > There might be other such fault injection callsites in hotpaths of other > subsystems but I didn't search for them at this point. > > [1] https://lore.kernel.org/all/6d5bb852-8703-4abf-a52b-90816bccbd7f@suse.cz/ > [2] https://lore.kernel.org/all/3j5d3p22ssv7xoaghzraa7crcfih3h2qqjlhmjppbp6f42pg2t@kg7qoicog5ye/ > > Signed-off-by: Vlastimil Babka > --- > Vlastimil Babka (4): > fault-inject: add support for static keys around fault injection sites > error-injection: support static keys around injectable functions > mm, slab: add static key for should_failslab() > mm, page_alloc: add static key for should_fail_alloc_page() > > include/asm-generic/error-injection.h | 13 ++++++++++- > include/asm-generic/vmlinux.lds.h | 2 +- > include/linux/error-injection.h | 9 +++++--- > include/linux/fault-inject.h | 7 +++++- > kernel/fail_function.c | 22 +++++++++++++++--- > lib/error-inject.c | 6 ++++- > lib/fault-inject.c | 43 ++++++++++++++++++++++++++++++++++- > mm/fail_page_alloc.c | 3 ++- > mm/failslab.c | 2 +- > mm/internal.h | 2 ++ > mm/page_alloc.c | 11 ++++++--- > mm/slab.h | 3 +++ > mm/slub.c | 10 +++++--- > 13 files changed, 114 insertions(+), 19 deletions(-) > --- > base-commit: 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0 > change-id: 20240530-fault-injection-statickeys-66b7222e91b7 > > Best regards, > -- > Vlastimil Babka > > --2003064516-301007669-1717361061=:1421375--