Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp764729lqh; Fri, 31 May 2024 16:44:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXDeLjI94UrpUZi+sVspss30HAh0DMu4mr9vteQmoAJ0llgyuwQAc/p6cAf15HsujA8h+JIjH+Kg2RCwU8urtARgiOQRjWtfktpAIGkcA== X-Google-Smtp-Source: AGHT+IGQDiiW0NVlKp9DJTSB+bo2kiyCSv5ljj99Db8HpF7SfiSdnl0D0l+HFe2aCOEIv/koW/4O X-Received: by 2002:ac8:7c47:0:b0:43e:ec0:c7a0 with SMTP id d75a77b69052e-43ff54cc056mr39990361cf.62.1717199074610; Fri, 31 May 2024 16:44:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717199074; cv=pass; d=google.com; s=arc-20160816; b=AgEbFNiCoFN1BAtuolLX2tPLHpcjKp3LnBSqUz5tzcW96NMs9oo8l7w9sDAvsuOAMa 3gRyLWSdKDe8OrPEY3uoKKbi86BIdyqT9zUXo7qA7wmJGEKAqNF+6JKXHDGYYLKzCPso s/PIkT88KBumcUN7GTMXbM8lx3rpUudyP6Z+j+RaYmoGJI8IYn5DihDwdVOMiS6KClRp H5IddTgL8+llSw7MTyYjtgPWygrKqHAA08BckhbBEnuL8dtbfgjzONo/NMz8q7ges6Ud M+JbznPngj14YXQskfQeSAVFSE1uL6PYQ5tpFzQqRXDZhBz6FKsCZZA/Xhk65eecW4IE Km3g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=QQSw4uPQgRlAk3kSFCT2kJLdIQ/8AieJ62AywbPlN10=; fh=2NJeHTOqRPUE7t/vJ0SarzTqJwlsdx+l7lWX9B8n0mc=; b=aT3MrjlWahHmk+bRymly2y1i+QrIVi1No6eh2MQ6uGCpx9DXxTZkLcgudgD044i5XE wkMrrOOqY5UZvLW5myNXD9Xr3llYZNtzYyTVDZ29wDAobISljIKnWNWEPGLMayTytiGC P8kIFvZigJUh6nT7H99o10zC0suv3zt2ErA451CULJvVKCfk+HI7KVGSDaJu4J6VR2g6 BNfqD0Q2iM4u5lRsWN08RLdMok3pBTEuqU+VeGMWnDdTTXpmaMHtvnRezWSrjj2906LB yLm4LgcUH2eU0E9aTWrm5De6B1h2MEYcKP6OcPZ66vXSpIGm+ihKisARn+lBSHHlHIHj 4Xtg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=JM4VUaWy; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-197602-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197602-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43ff23dbce9si32478171cf.202.2024.05.31.16.44.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 16:44:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197602-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=@linux.dev header.s=key1 header.b=JM4VUaWy; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-197602-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197602-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 546E91C22EF3 for ; Fri, 31 May 2024 23:44:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B640112F5A3; Fri, 31 May 2024 23:44:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="JM4VUaWy" Received: from out-189.mta1.migadu.com (out-189.mta1.migadu.com [95.215.58.189]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 41DB612C499 for ; Fri, 31 May 2024 23:44:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.189 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717199067; cv=none; b=Rth04IkGBp6UM8tHabIxRRnlbtyUNG+adOeiM3cmJMXQ15Lk4UBFhyIA63WE1BY1dX9EnQJh9bwyBijrafXva1CJQRxz6IROhLQC8HJisZ3WLx7h9L5zLU3cHhJgmrH57zMEP1yU1Gx8gGBWkZoj5owMnMwuvK9oMEfiIMU7utQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717199067; c=relaxed/simple; bh=+1lYI39XvWKgc3DpuRrlaTX27AIFQ1b7IGpUMM1waoU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lPDToCwvd8yU/A9Ovq2irMjKEpsuLuP0YdAQbeDpSvsLXBLj4lfyEM7zm6Xnq1qlV250eRFX8rq2kXMoPDiU7ulaollEnehW3ps/Gg7jAPOUG25zdTBx/54l/rfBsC1qv+1PMwXwgg/D1omBvcRiIyEYYyuQSjUIUrmpa8eL4xQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=JM4VUaWy; arc=none smtp.client-ip=95.215.58.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: vbabka@suse.cz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1717199064; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QQSw4uPQgRlAk3kSFCT2kJLdIQ/8AieJ62AywbPlN10=; b=JM4VUaWyXQA4oPsqLQCYJRQ+U5ltEWNYbqydiC0118Lvw8ARSRQKxDtoz/LXNP3l36eZfL /0+mD9xqfT1uKyARczwtW716OzeJDqc/dzWzcB7fmug0ExijVA7JmuW/f4IgXve4nDh6uQ An09w1e8j9woSKGsMHLCxhQsgpbmDFs= X-Envelope-To: akinobu.mita@gmail.com X-Envelope-To: cl@linux.com X-Envelope-To: rientjes@google.com X-Envelope-To: ast@kernel.org X-Envelope-To: daniel@iogearbox.net X-Envelope-To: andrii@kernel.org X-Envelope-To: naveen.n.rao@linux.ibm.com X-Envelope-To: anil.s.keshavamurthy@intel.com X-Envelope-To: davem@davemloft.net X-Envelope-To: mhiramat@kernel.org X-Envelope-To: rostedt@goodmis.org X-Envelope-To: mark.rutland@arm.com X-Envelope-To: jolsa@kernel.org X-Envelope-To: 42.hyeyoo@gmail.com X-Envelope-To: linux-kernel@vger.kernel.org X-Envelope-To: linux-mm@kvack.org X-Envelope-To: bpf@vger.kernel.org X-Envelope-To: linux-trace-kernel@vger.kernel.org Date: Fri, 31 May 2024 16:44:16 -0700 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Vlastimil Babka 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 , 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 3/4] mm, slab: add static key for should_failslab() Message-ID: References: <20240531-fault-injection-statickeys-v1-0-a513fd0a9614@suse.cz> <20240531-fault-injection-statickeys-v1-3-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: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240531-fault-injection-statickeys-v1-3-a513fd0a9614@suse.cz> X-Migadu-Flow: FLOW_OUT On Fri, May 31, 2024 at 11:33:34AM +0200, Vlastimil Babka wrote: > Since commit 4f6923fbb352 ("mm: make should_failslab always available for > fault injection") should_failslab() is unconditionally a noinline > function. This adds visible overhead to the slab allocation hotpath, > even if the function is empty. With CONFIG_FAILSLAB=y there's additional > overhead when the functionality is not enabled by a boot parameter or > debugfs. > > The overhead can be eliminated with a static key around the callsite. > Fault injection and error injection frameworks can now be told that the > this function has a static key associated, and are able to enable and > disable it accordingly. > > Signed-off-by: Vlastimil Babka Reviewed-by: Roman Gushchin