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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A31AC433EF for ; Thu, 7 Oct 2021 15:50:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A94DA610E6 for ; Thu, 7 Oct 2021 15:50:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A94DA610E6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 3008B6B006C; Thu, 7 Oct 2021 11:50:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2B0816B0074; Thu, 7 Oct 2021 11:50:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 19F30900002; Thu, 7 Oct 2021 11:50:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0068.hostedemail.com [216.40.44.68]) by kanga.kvack.org (Postfix) with ESMTP id 0BC236B006C for ; Thu, 7 Oct 2021 11:50:15 -0400 (EDT) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id B5A9318063872 for ; Thu, 7 Oct 2021 15:50:14 +0000 (UTC) X-FDA: 78670077948.31.D37CD6C Received: from mail-il1-f173.google.com (mail-il1-f173.google.com [209.85.166.173]) by imf09.hostedemail.com (Postfix) with ESMTP id F0DF530008DD for ; Thu, 7 Oct 2021 15:50:13 +0000 (UTC) Received: by mail-il1-f173.google.com with SMTP id w11so3622188ilv.6 for ; Thu, 07 Oct 2021 08:50:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=RITICfm+7VYo1WW7xYDzpKcdCcOOA5uOvj4tCcim4Ak=; b=gu0pT/qYUzONLbPr9vB0YiA85WJDIddbdUyoOKSuRDutS0uHTMYLpCREwZafMUO9f9 8X8mCDi3RtPheYuF4ZTB6EwolpOJIjc2Q9RpHmmEne0NfwgROQJ+OMwov65V58ueho0s dG9i9lT4RlEMsUOIPdU4sWpI8T7uGRsM6FwOrBGfjEgDRIKgmypZFAXhbiLk+Hg09Iw5 wtBCwlEcqoPWGmWhcNiU4U4bvGXvTLY0g75h7jmYDy/TBosr3Rf4feYiNY+K74gVv+Lk fjC60wmJ+/Xthm2ykWguRXKkjW9XJ3KzMO+eHvxdVRCqY203XVUnLenyG6F1P24sYFxG oTMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=RITICfm+7VYo1WW7xYDzpKcdCcOOA5uOvj4tCcim4Ak=; b=1PpK/Go+AjcSuvTEqKRYLjphj8Vie+08XSJJg6hnPi+KgZngYeTLXJ4PnSds4WcbYE Z3KtAOynaqEJWfYlpjIPdQOGc7N0IqGC5hfGaS/k4DnV/F/BAFZls0VmdIAG7le+lkxU kFynCsyS0tq9VyBY+dfFG1VD20DiqTT8ex+spbPdhcYELEVssMSaQg5TDclcEyAVtpXE gwqDwYBEh9SyARLkcRDY48jooEc/aww/LaoL+WlqGpn30yjwpRj2G2zvSRMwhlMEuZjN 5+/u9gxBdZvzpM48Mu1TWkcyPolFx4/l67InH5SpIoMvXZ9KzK/cwEkSHdMC2t1XrvQZ nKvA== X-Gm-Message-State: AOAM533DS7Inf+iVKssy1rc1H7Dck12FxmV4xd9JaDtU3z8ymQPSICqg zZmo5FOBzwY0ZNHjdKwSlIlhfw== X-Google-Smtp-Source: ABdhPJwb4fVsbpDwt+DFKerTQztEhR1azA6TWSbTZNML7iUF1Mv+Ztq3oyfJY/ksEuSSgTHhA/3SKQ== X-Received: by 2002:a05:6e02:1909:: with SMTP id w9mr4101515ilu.34.1633621813203; Thu, 07 Oct 2021 08:50:13 -0700 (PDT) Received: from [192.168.1.30] ([207.135.234.126]) by smtp.gmail.com with ESMTPSA id r19sm13699259iot.0.2021.10.07.08.50.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Oct 2021 08:50:12 -0700 (PDT) Subject: Re: [PATCH] mm: don't call should_failslab() for !CONFIG_FAILSLAB To: Vlastimil Babka , LKML , Linux Memory Management List , Andrew Morton , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Jesper Dangaard Brouer , Christoph Lameter , David Rientjes , Pekka Enberg , Joonsoo Kim , Yonghong Song , John Fastabend , KP Singh , Howard McLauchlan Cc: bpf@vger.kernel.org References: <2dfc6273-6cdd-f4f5-bed9-400873ac9152@suse.cz> From: Jens Axboe Message-ID: <082f30c7-9a7c-b2de-6d30-99fa38150d48@kernel.dk> Date: Thu, 7 Oct 2021 09:50:11 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <2dfc6273-6cdd-f4f5-bed9-400873ac9152@suse.cz> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: F0DF530008DD X-Stat-Signature: 1mxjjhja4jyijkehpufzhwwm7nir1nue Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b="gu0pT/qY"; spf=pass (imf09.hostedemail.com: domain of axboe@kernel.dk designates 209.85.166.173 as permitted sender) smtp.mailfrom=axboe@kernel.dk; dmarc=none X-HE-Tag: 1633621813-879031 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 10/7/21 9:32 AM, Vlastimil Babka wrote: > On 10/5/21 17:31, Jens Axboe wrote: >> Allocations can be a very hot path, and this out-of-line function >> call is noticeable. >> >> Signed-off-by: Jens Axboe > > It used to be inline b4 (hi, Konstantin!) and then was converted to be like > this intentionally :/ > > See 4f6923fbb352 ("mm: make should_failslab always available for fault > injection") > > And now also kernel/bpf/verifier.c contains: > BTF_ID(func, should_failslab) > > I think either your or Andrew's version will break this BTF_ID thing, at the > very least. > > But I do strongly agree that putting unconditionally a non-inline call into > slab allocator fastpath sucks. Can we make it so that bpf can only do these > overrides when CONFIG_FAILSLAB is enabled? > I don't know, perhaps putting this BTF_ID() in #ifdef as well, or providing > a dummy that is always available (so that nothing breaks), but doesn't > actually affect slab_pre_alloc_hook() unless CONFIG_FAILSLAB has been enabled? That seems to be the right approach, limiting it on it actually being enabled and a function call. -- Jens Axboe