From patchwork Wed Oct 4 11:19:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Guzik X-Patchwork-Id: 13408645 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2380AE7B5F1 for ; Wed, 4 Oct 2023 11:19:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242238AbjJDLTj (ORCPT ); Wed, 4 Oct 2023 07:19:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233041AbjJDLTj (ORCPT ); Wed, 4 Oct 2023 07:19:39 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6090AA6; Wed, 4 Oct 2023 04:19:35 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3247d69ed2cso1979923f8f.0; Wed, 04 Oct 2023 04:19:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696418374; x=1697023174; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Kf65/yVeNmyfkA4lS1pa8yQ0o4/BpEGkDZRgGsIHS3U=; b=R15xLWN6GjHcO9jTCsl53ZZB3fKJ9UQ6Vcb70YIu7rfvArk6poxv2OM7FEnlVEzVQh s2qAk6acFv1gmuV06eExFHxuxlMqR1AAAU46sKzdgor0pJuk1IN87OfuoMj+hdXuSUwv CTmkDVIv9p8t27xeCIjigD6AG1tCnRlnAhmO5fM4UPHQq/e294g6m0oFlyUlXxZGFjws K4QnZ8EmISZ30lE2LQcNOvKq4rEQ6C8Tqlje0+FD72OnZGIjPE+RnMq6c+Ag1MtkGm3T D3xRVM7VOBgJP5Ep21icx5iYCLx6fMvls0zuW6Zs9K9b3f7KqGHZkDm5nIxj8zJFl65H uawQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696418374; x=1697023174; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Kf65/yVeNmyfkA4lS1pa8yQ0o4/BpEGkDZRgGsIHS3U=; b=Rra/HK/Y3atdHjwDyv41QiikENaqRmraQUbaPQyfzYVLHmHihWwe8N2Sutb+cAUYTn PMUQBwT9ppypnLFAvAO3Ih/e+Xw9xiVYJqy3emDSMJ6McOoz8kSWgYccbAwCiGANDDkM G34N2U6B8tnDxPLU2WgJSBWP6P95g9EuVQdG17xCUDYqthgVQfDSDjAjgxdYD8jhnc6Q /C/E+fIw3YQVbyi3rgERLd8MTr7Ei6nlr0ukuDaWHh+T3fPouJ3727f1u1AxrU3b0mFy 2qdDnLk6nFmmS4118I85NUsr9IH+NaH2eovncGl+zsy9lCUDt0gmI4dEXsjQ0cu9NKXW VJIw== X-Gm-Message-State: AOJu0YxNgU01VhmcTBLPguGyqC11nJ24c80vnEHPJKXE6l2AE1dYNvbU i1PAfC/suqJUnt8IjcqePNk= X-Google-Smtp-Source: AGHT+IHmTUcZ7mM33uNUbLKb56C+w5MA0UCGPTVksvmyVHoDcFNO+Fk7Slzn+L+w5t3llCzqu5EQmA== X-Received: by 2002:adf:fe88:0:b0:319:f9d6:a769 with SMTP id l8-20020adffe88000000b00319f9d6a769mr1981989wrr.45.1696418373766; Wed, 04 Oct 2023 04:19:33 -0700 (PDT) Received: from f.. (cst-prg-67-191.cust.vodafone.cz. [46.135.67.191]) by smtp.gmail.com with ESMTPSA id o16-20020adfead0000000b003266ece0fe2sm3761527wrn.98.2023.10.04.04.19.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 04:19:33 -0700 (PDT) From: Mateusz Guzik To: brauner@kernel.org Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Mateusz Guzik Subject: [PATCH 1/2] vfs: predict the error in retry_estale as unlikely Date: Wed, 4 Oct 2023 13:19:15 +0200 Message-Id: <20231004111916.728135-2-mjguzik@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231004111916.728135-1-mjguzik@gmail.com> References: <20231004111916.728135-1-mjguzik@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Signed-off-by: Mateusz Guzik --- include/linux/namei.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/namei.h b/include/linux/namei.h index 1463cbda4888..689b16f3031b 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h @@ -112,7 +112,7 @@ static inline void nd_terminate_link(void *name, size_t len, size_t maxlen) static inline bool retry_estale(const long error, const unsigned int flags) { - return error == -ESTALE && !(flags & LOOKUP_REVAL); + return unlikely(error == -ESTALE && !(flags & LOOKUP_REVAL)); } #endif /* _LINUX_NAMEI_H */ From patchwork Wed Oct 4 11:19:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Guzik X-Patchwork-Id: 13408646 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A43FFE7B5EE for ; Wed, 4 Oct 2023 11:19:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242251AbjJDLTo (ORCPT ); Wed, 4 Oct 2023 07:19:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242245AbjJDLTn (ORCPT ); Wed, 4 Oct 2023 07:19:43 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25ED6E5; Wed, 4 Oct 2023 04:19:39 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-40675f06f1fso4630435e9.1; Wed, 04 Oct 2023 04:19:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696418377; x=1697023177; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LdSMOqyI/Qm2nBy4+9Nq5mSXBIbAfD+yRNlJMg5NxcI=; b=nozvkPIcSknqpkVEgY2Rzlp2QcitOBor26uqinVrTN26tfxYvkkcFhcVwKBpM3sHp3 disW0hQSFrJpUzsDnLS6iD7XGQn3xfVCQrZnhWY/pm+WzZi8phgP/sSHZa/nH5XWRK+z 4qLS6OUQxt7ODKauSb6cLeLypryGm06dTgoeotMyFJlPaBSN67c07hf/whRwjOzrBaEa iOr+lHonaiVXeFlb4APqlAd1jvuStTgTfd3fatBcgFiKhHa+r9kuCJOmYe+QjGmSSi6x Svytw22uj9z4pAksIyHlvbTs09eAYEX/aDnTkRCJgL1fzB31W37HyRjQaMMqo00YlsOS NPmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696418377; x=1697023177; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LdSMOqyI/Qm2nBy4+9Nq5mSXBIbAfD+yRNlJMg5NxcI=; b=PLhP3deebjIPjQQIE2hoKd9AJe+VdbgMN4Qbvt1wsd9y5jE4DFzTBLSTKavS9ZLQQf 7tt2BgvvBRk5aRXEkRyh9CGYUu9QeZIv8un897C784pQYizsbHbfjcGuT3+aZrElwGZG L48rhtmlFdZXM1R06UolghPxktMwwUVxBQ/eFFt5fdY0BuVBcoSbIYTfSUm1jEh2MTHf jBTPEHZbmpbQbpqCRD+M2PDlt/8jp9Lh060UtBwtEJO2lgv7542a1/MejMpg39Y/7Jiq mGRGbUQGqItkCaVNSxZW2sIGlWfefLjShMb9Wj2HFX2MqoFtYyYpUVfhvZKjBnlvGQcs tMXQ== X-Gm-Message-State: AOJu0YzAeODohOLO44wegOsf29YYoHsgdi7026hDK18xkaRziud3q2az lxwTvV9j/qrFK4PNdpCz7fkXax7OQSM= X-Google-Smtp-Source: AGHT+IGfm/7SJFfAziYdhTOsE+/Het/A9KoBfNR0Xm8lxr9whAquAp73f8w7asbiyaeE/YD43LVORg== X-Received: by 2002:a05:600c:4689:b0:405:29ba:9b5c with SMTP id p9-20020a05600c468900b0040529ba9b5cmr4403104wmo.16.1696418377246; Wed, 04 Oct 2023 04:19:37 -0700 (PDT) Received: from f.. (cst-prg-67-191.cust.vodafone.cz. [46.135.67.191]) by smtp.gmail.com with ESMTPSA id o16-20020adfead0000000b003266ece0fe2sm3761527wrn.98.2023.10.04.04.19.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 04:19:36 -0700 (PDT) From: Mateusz Guzik To: brauner@kernel.org Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Mateusz Guzik Subject: [PATCH 2/2] vfs: stop counting on gcc not messing with mnt_expiry_mark if not asked Date: Wed, 4 Oct 2023 13:19:16 +0200 Message-Id: <20231004111916.728135-3-mjguzik@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231004111916.728135-1-mjguzik@gmail.com> References: <20231004111916.728135-1-mjguzik@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org So happens it already was not doing it, but there is no need to "hope" as indicated in the comment. No changes in generated assembly. Signed-off-by: Mateusz Guzik --- fs/namespace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/namespace.c b/fs/namespace.c index e157efc54023..d785bcb75111 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -1344,9 +1344,9 @@ void mntput(struct vfsmount *mnt) { if (mnt) { struct mount *m = real_mount(mnt); - /* avoid cacheline pingpong, hope gcc doesn't get "smart" */ + /* avoid cacheline pingpong */ if (unlikely(m->mnt_expiry_mark)) - m->mnt_expiry_mark = 0; + WRITE_ONCE(m->mnt_expiry_mark, 0); mntput_no_expire(m); } }