From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from 18.mo581.mail-out.ovh.net (18.mo581.mail-out.ovh.net [188.165.56.163]) (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 E33BE29D27D for ; Mon, 22 Jun 2026 19:13:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=188.165.56.163 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782155601; cv=none; b=QTJQCJ+UmrOQh9ggKfzoKRAJgn6nigwoQAtuftukdlD4JOsZmc0ieereQ0XVcfNcXwA/++dZb9eVFD9Mz0R+TRWCEvcrb+N7mj+KPUY4mwla2ncOtuZM3SM0XRePx2K/GQQnpTd9CN5fPe0XvZ+ccINt5OoxfB52e+4xjNAaTmI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782155601; c=relaxed/simple; bh=QFVNcbUmf7knt2wDTPFQrIQVeLimzfcml0Z0p5TcKIQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=FmxYRzP9/9pSyTElY3DmzqfeiEr0ppualGorTtM3+lzSh5ewGXLIzY23hBNb1QtzeOUHkX8B5QpV9dmL2kg8ztxPA3jVMmBsx5gNgtkrldAIK1KDAZNLr1si8/NdlfYk36Vnt1j520TZWlCDBB1okM4GBfdiUtrHJtezeIHKX4A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=medichon.fr; spf=pass smtp.mailfrom=medichon.fr; dkim=pass (2048-bit key) header.d=medichon.fr header.i=@medichon.fr header.b=BsIS7TxL; arc=none smtp.client-ip=188.165.56.163 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=medichon.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=medichon.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=medichon.fr header.i=@medichon.fr header.b="BsIS7TxL" Received: from director6.ghost.mail-out.ovh.net (unknown [10.109.254.104]) by mo581.mail-out.ovh.net (Postfix) with ESMTP id 4gkbVl54YSz5ydx for ; Mon, 22 Jun 2026 17:56:47 +0000 (UTC) Received: from ghost-submission-7d8d68f679-ghq26 (unknown [10.110.188.223]) by director6.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 1A2C58017F; Mon, 22 Jun 2026 17:56:47 +0000 (UTC) Received: from medichon.fr ([37.59.142.101]) by ghost-submission-7d8d68f679-ghq26 with ESMTPSA id evTZOl53OWrOIhsAiGv3aQ (envelope-from ); Mon, 22 Jun 2026 17:56:47 +0000 Authentication-Results:garm.ovh; auth=pass (GARM-101G004a5c92367-d45f-4fa1-b838-077d5a9abd0f, 7290A200C2C875F1DE80999D0334B60B5F55D5D1) smtp.auth=abo@medichon.fr X-OVh-ClientIp:88.190.90.129 From: Arnaud Bonnet To: trondmy@kernel.org, anna@kernel.org Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, code@agatha.dev, skhan@linuxfoundation.org, me@brighamcampbell.com, jkoolstra@xs4all.nl, Arnaud Bonnet Subject: [PATCH 0/2] nfs: refactor bit operations using clear_and_wake_up_bit Date: Mon, 22 Jun 2026 19:55:09 +0200 Message-ID: X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit x-ovh-tracer-id: 8601593814169181790 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: dmFkZTEYiaRYT3r9jlIA0oEG4B6jh3fy9pIW0eb/Th3QyottCtY5waIWuKOMmq16quGabDO2oXzpz1USi008BQP4mzbxJ3kZ5hl29krUeN2bkEXUYNdhne96a4pl7N5NG74aO0TuD1Rl5nrYv9Wme0yAz9i0KzyaUk6cWKoYaLQKTDRzv/hrNhGUtVW1VsPgoaFm9ieK3H/yJo+V1Rw974yQdNkinl/OVG4Z1rYtE/hB/2abuNcJeGMio34EqprhYAf0nqkz70kz2xTyhrwcTqXaJVv7knDnj/mkbzuf2XSeoDP7PRFw8nc4PDO1L4UF/xdE+/7vsoGnT1BEuAgGVCDXLRgqEeqx1FaTdDL+AA/N9kxFi3gocFJBDWG5BP4qnz3vK/NJGVcVAb4X0AyJRmM/Y6mST9L8Is0gYW33/4Ls1u5RRMGUxxFFaQt0OwYvpebHunAbZW6TD1M/7VGLaHzUTcM3RaDYxqqqrYzoRvQ56wAi8sUyFo9Be5L28TzEBtRQEbw299zeTI7n7OySGMdN0NGxC56J339m00Cx22zgDwe3VXL/qPEqCNKXgnMsoMYJdJYLGyrlBUqPlMhoZseU6xIejqXpcoCG0ADHTPe/+Izg1dJQJe8+Mqjxxd3gibrr6NkU+qipM3E/R6vjSUXh5Pt7mf+b5F3Hn6oRE6VBa/Jq2Q DKIM-Signature: a=rsa-sha256; bh=I4XupfxaOi3hDJ4E5xk1CLtm675cjM3xvj6zaVMvTMc=; c=relaxed/relaxed; d=medichon.fr; h=From; s=ovhmo3801317-selector1; t=1782151007; v=1; b=BsIS7TxLyn3KoZgs7poe3f9/tHUf1UtY65+qhlFWt9OP2FGFZxjNn4aiRBjBgX6ZiFdVDaOK 29ghcmcYFb4V4Q8ufkTVqZvFTlj6ZYRJWpXgI+3XePBHQCVFzEoaCU/xsgRwmYigPkF6pt0Hj71 0Zu01+5ek1L4SkiEljDFY+7Ys32ws9k/cApEpC9Ji67NjR7zHVTcmd4kAaDdYaIroDc8spe7opT E9RgX67KURQrRZWSw4dAmTYt293nFkFkJ5/HWGcq+1p8vx88M7qjFH0sN0ONxuavuzdGhs3++82 CxtWasjEXtZ3w31UVA75OMyoZF5YM50Hb2nGY3+LLyKpA== Several functions in nfs code use the exact following sequence of calls when dealing with flags: clear_bit_unlock(); smp_mb__after_atomic(); wake_up_bit(); Since commit 8236b0ae31c8 ("bdi: wake up concurrent wb_shutdown() callers.") came the helper clear_and_wake_up_bit() for this exact purpose, and has since been adopted by several subsystems, including vfs. This function is already used in files such as nfs4state.c and pnfs_nfs.c and this serie aims to continue this effort, which also allows to remove some no longer used code. Tested on x86 hardware using a loopback pNFS SCSI layout: * doing image compression/decompression using xz and * recompiling tinyconfig kernels on the remounted partition No error reported under sanitizers. Suggested-by: Agatha Isabelle Moreira Link: https://kernelnewbies.org/Beginner%20Cleanup%20and%20Refactor%20Tasks%20by%20Agatha%20Isabelle%20Moreira#task_007 Signed-off-by: Arnaud Bonnet --- Arnaud Bonnet (2): nfs: replace atomic bitops sequence with clear_and_wake_up_bit helper nfs: refactor pNFS functions using clear_and_wake_up_bit fs/nfs/inode.c | 4 +--- fs/nfs/pnfs.c | 35 ++++++++++------------------------- 2 files changed, 11 insertions(+), 28 deletions(-) -- 2.53.0