Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp186187lqj; Sat, 1 Jun 2024 13:57:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV+sGbmERuhjWOQl9N9fSM3JNZuim2wyDCAPOD4ZBCEd4oAuSEM0wPY0W2nYk7EEUZyfasGWb4AnVDfXkQvo5+Rqk/UZ/eTz6H/z8GZnA== X-Google-Smtp-Source: AGHT+IGYqY3MY/rGwUBjboyOx/Y/nESSdljBLrTD5MnaLLaAacmnCJzzmt7+zF2YqNuMyUGNmaQR X-Received: by 2002:a50:cd50:0:b0:574:f83d:b282 with SMTP id 4fb4d7f45d1cf-57a19d4e94dmr7644015a12.2.1717275464945; Sat, 01 Jun 2024 13:57:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717275464; cv=pass; d=google.com; s=arc-20160816; b=Hbj53o/iGugsdnoxYu/q/hqu+hY2vgefMcuTADVpr+dCf839aPNAYH/9t9N/PAhQs2 tNuGfsXtqdGT6T/+r0WOdhndsoduKJUQPIuxYfLg/3z9uMgEJ8CEV2i5orPLXZbM07dX nMcY7xDuiHuTmLva4nNfqTSs7FEGj1Imajfnjv8Pi468P6EV+MKybM1jC/5AYm5XcXG3 MsYXELUApYfKaM+BG6oAGX4RcwFhzwztHBN43teJvprgzIS/lTdSmO9eJ5ahmb7a6Tjc RCy64xlxYSLIsd3lcUghInvv23RcKo6GcXCHj4g3kl/m/N+nITz05k2aSyXzZUl3uvIS hRkg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature:dkim-signature:dkim-signature:dkim-signature; bh=sdwLj2tSWPNRHYkE+3C7SIZSn6lY5twCIc2iCsFfwNM=; fh=+3p4QXfGRKLMm3PJLNbCwM5RBZJh5J2+B5wvUSVD6jA=; b=rLH/Uc3Be2zNdDKUiQYLHnYVGebnhjzU/bzM3iPKU6TXjcH1FB9wVm/WgofjxXUxXp wkQhKT1MdCykQGIK78ubcYncYfniB2fi+5HQHvnwnuKaWPvID7pvrWhp2srWV/um3bHF DDj77sdmUYYe2IvWl+Yq48BF486cQkBHUA14DyQ2bQQlXy9kGSgWqgmktrGi50hZZ5n9 U08DqyUrmBlkccBiioyyJI/1HrvXuifXuTpVpebFkcDw8paJfKyH5GG7SGdGgQMoGK7P 4lBG5B04v0XDwXlWi6DFu9ZyDd6lexxpeefiry3lciv91WrOnJ4SzTZzo7DCdFDR0uAu ydng==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=tpknI5pC; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=17HFFBhh; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Ca9BZNED; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=n0u95+ll; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-198006-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198006-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57a31ca5558si2269302a12.525.2024.06.01.13.57.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Jun 2024 13:57:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198006-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=tpknI5pC; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=17HFFBhh; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Ca9BZNED; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=n0u95+ll; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-198006-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198006-linux.lists.archive=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 75D601F21BAB for ; Sat, 1 Jun 2024 20:57:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9281E154C19; Sat, 1 Jun 2024 20:57:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="tpknI5pC"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="17HFFBhh"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="Ca9BZNED"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="n0u95+ll" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 EE7E41CAA6; Sat, 1 Jun 2024 20:57:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717275453; cv=none; b=bXrqGhIPOd8ZKHaDi9B+nc53GNo8ONw70VNMA8Tv3jXFFzXAYgomrEO4Zzm3WBFgm/YvdH8d9BG0q1OuT7i2j9eYX/OoMkh7VnAbXJVOfnHO89PUt76vVRymqyPjTyRenIV3mHUKKqgIJK9k9TErBQYyJa9VSyWRpJApqDr3loE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717275453; c=relaxed/simple; bh=fDnSI924w+lWGTroEDCTpTzFk2Ipb3IKwyuboq33CQs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=uXIMKr+DjpwGF6opDE5Ar6e1peoVNvAOdBG2py52EZ4cHDFapm1+hxoEwvw56HzRsIEfjaGUxZQJ13HsuMs3T/WkoOHAU5VB/AVO52aAsdBchP6gl5s7IPuAQIVPR6eBAMAmDRaiLH2eTpEOJONii12sUguKbvEOq1WbZ3x+PTc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=tpknI5pC; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=17HFFBhh; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=Ca9BZNED; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=n0u95+ll; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104: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-out2.suse.de (Postfix) with ESMTPS id DE4BE1FEE9; Sat, 1 Jun 2024 20:57:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1717275450; 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: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=sdwLj2tSWPNRHYkE+3C7SIZSn6lY5twCIc2iCsFfwNM=; b=tpknI5pCyrN+tGi6dibNCwO/BkeEgWCtHethdmF3THSqZfZF/1/CgAMt5WB+hGp5LQP97p zBSXoipUbdS8pT6FbwML/EUHueDFWMK1VY2GeFI3oJzZbuMYp9zY8BWALhvo17l0N7PqEX DzWhr6oYEhgyhROB9tpEdbJi7kQW83U= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1717275450; 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: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=sdwLj2tSWPNRHYkE+3C7SIZSn6lY5twCIc2iCsFfwNM=; b=17HFFBhh4Ul/dDi3Zdi/u0u2X9H0e68qPFVOx1G7S1Y5e5AOv3c1Ci3Vmc86SFyX9dFlay l4Eu1BWI3nEeSuAg== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=Ca9BZNED; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=n0u95+ll DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1717275449; 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: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=sdwLj2tSWPNRHYkE+3C7SIZSn6lY5twCIc2iCsFfwNM=; b=Ca9BZNEDts/a/va7zEWTVUH/mGZ7SLs5vPuuMjFiGsJkD3AWQc+qn2mxZx16ZE9qUlIQDt g+Rdp/jF3VFIBanR8bqEo8a8hcTIiWM5cZ7BugEgld9tByCPPZRh1rZEcN82s+BvVMI0g9 2mAlgcb/kIajOxAgweBAEFA6zM4l9bM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1717275449; 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: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=sdwLj2tSWPNRHYkE+3C7SIZSn6lY5twCIc2iCsFfwNM=; b=n0u95+ll0YnCbLbkSfdozk+of17rlI8cH8DQQfIyWSm7t39n2Z9khEMyyHWpWAGQSp1jtb lGtqytl3W+U6LZAw== 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 ABDCB137C3; Sat, 1 Jun 2024 20:57:29 +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 Z8NOKTmLW2a6TwAAD6G6ig (envelope-from ); Sat, 01 Jun 2024 20:57:29 +0000 Message-ID: Date: Sat, 1 Jun 2024 22:57:29 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RFC 3/4] mm, slab: add static key for should_failslab() Content-Language: en-US To: Alexei Starovoitov Cc: Akinobu Mita , Christoph Lameter , David Rientjes , 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>, LKML , linux-mm , bpf , linux-trace-kernel References: <20240531-fault-injection-statickeys-v1-0-a513fd0a9614@suse.cz> <20240531-fault-injection-statickeys-v1-3-a513fd0a9614@suse.cz> From: Vlastimil Babka Autocrypt: addr=vbabka@suse.cz; keydata= xsFNBFZdmxYBEADsw/SiUSjB0dM+vSh95UkgcHjzEVBlby/Fg+g42O7LAEkCYXi/vvq31JTB KxRWDHX0R2tgpFDXHnzZcQywawu8eSq0LxzxFNYMvtB7sV1pxYwej2qx9B75qW2plBs+7+YB 87tMFA+u+L4Z5xAzIimfLD5EKC56kJ1CsXlM8S/LHcmdD9Ctkn3trYDNnat0eoAcfPIP2OZ+ 9oe9IF/R28zmh0ifLXyJQQz5ofdj4bPf8ecEW0rhcqHfTD8k4yK0xxt3xW+6Exqp9n9bydiy tcSAw/TahjW6yrA+6JhSBv1v2tIm+itQc073zjSX8OFL51qQVzRFr7H2UQG33lw2QrvHRXqD Ot7ViKam7v0Ho9wEWiQOOZlHItOOXFphWb2yq3nzrKe45oWoSgkxKb97MVsQ+q2SYjJRBBH4 8qKhphADYxkIP6yut/eaj9ImvRUZZRi0DTc8xfnvHGTjKbJzC2xpFcY0DQbZzuwsIZ8OPJCc LM4S7mT25NE5kUTG/TKQCk922vRdGVMoLA7dIQrgXnRXtyT61sg8PG4wcfOnuWf8577aXP1x 6mzw3/jh3F+oSBHb/GcLC7mvWreJifUL2gEdssGfXhGWBo6zLS3qhgtwjay0Jl+kza1lo+Cv BB2T79D4WGdDuVa4eOrQ02TxqGN7G0Biz5ZLRSFzQSQwLn8fbwARAQABzSBWbGFzdGltaWwg QmFia2EgPHZiYWJrYUBzdXNlLmN6PsLBlAQTAQoAPgIbAwULCQgHAwUVCgkICwUWAgMBAAIe AQIXgBYhBKlA1DSZLC6OmRA9UCJPp+fMgqZkBQJkBREIBQkRadzn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EKACYCGwwWIQSpQNQ0mSwujpkQ PVAiT6fnzIKmZAUCZAUSmwUJDK5EZgAKCRAiT6fnzIKmZOJGEACOKABgo9wJXsbWhGWYO7mD 8R8mUyJHqbvaz+yTLnvRwfe/VwafFfDMx5GYVYzMY9TWpA8psFTKTUIIQmx2scYsRBUwm5VI EurRWKqENcDRjyo+ol59j0FViYysjQQeobXBDDE31t5SBg++veI6tXfpco/UiKEsDswL1WAr tEAZaruo7254TyH+gydURl2wJuzo/aZ7Y7PpqaODbYv727Dvm5eX64HCyyAH0s6sOCyGF5/p eIhrOn24oBf67KtdAN3H9JoFNUVTYJc1VJU3R1JtVdgwEdr+NEciEfYl0O19VpLE/PZxP4wX PWnhf5WjdoNI1Xec+RcJ5p/pSel0jnvBX8L2cmniYnmI883NhtGZsEWj++wyKiS4NranDFlA HdDM3b4lUth1pTtABKQ1YuTvehj7EfoWD3bv9kuGZGPrAeFNiHPdOT7DaXKeHpW9homgtBxj 8aX/UkSvEGJKUEbFL9cVa5tzyialGkSiZJNkWgeHe+jEcfRT6pJZOJidSCdzvJpbdJmm+eED w9XOLH1IIWh7RURU7G1iOfEfmImFeC3cbbS73LQEFGe1urxvIH5K/7vX+FkNcr9ujwWuPE9b 1C2o4i/yZPLXIVy387EjA6GZMqvQUFuSTs/GeBcv0NjIQi8867H3uLjz+mQy63fAitsDwLmR EP+ylKVEKb0Q2A== In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Level: X-Spamd-Result: default: False [-3.00 / 50.00]; BAYES_HAM(-3.00)[100.00%]; SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; XM_UA_NO_VERSION(0.01)[]; MX_GOOD(-0.01)[]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; TO_DN_ALL(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; RCPT_COUNT_TWELVE(0.00)[20]; FUZZY_BLOCKED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; FREEMAIL_CC(0.00)[gmail.com,linux.com,google.com,kernel.org,iogearbox.net,linux.ibm.com,intel.com,davemloft.net,goodmis.org,arm.com,linux.dev,vger.kernel.org,kvack.org]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TAGGED_RCPT(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.cz:+]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.cz:dkim,suse.cz:email] X-Rspamd-Action: no action X-Rspamd-Queue-Id: DE4BE1FEE9 X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Flag: NO X-Spam-Score: -3.00 On 5/31/24 6:43 PM, Alexei Starovoitov wrote: > On Fri, May 31, 2024 at 2:33 AM Vlastimil Babka wrote: >> might_alloc(flags); >> >> - if (unlikely(should_failslab(s, flags))) >> - return NULL; >> + if (static_branch_unlikely(&should_failslab_active)) { >> + if (should_failslab(s, flags)) >> + return NULL; >> + } > > makes sense. > Acked-by: Alexei Starovoitov Thanks :) but please note the cover letter where I explain how I need help with the bpftrace side (and ftrace, but that seems sorted). Without that part, bpftrace will silently stop doing the injection as the static key will remain disabled. > Do you have any microbenchmark numbers before/after this optimization? Also in cover letter, but will include it in the patch commit log next time.