Linux NFS development
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: Jeff Layton <jlayton@kernel.org>,
	Trond Myklebust <trondmy@kernel.org>,
	Anna Schumaker <anna@kernel.org>, NeilBrown <neil@brown.name>,
	Olga Kornievskaia <okorniev@redhat.com>,
	Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>
Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH v2 1/2] sunrpc: remove dfprintk_cont() and dfprintk_rcu_cont()
Date: Wed, 27 Aug 2025 10:41:25 -0400	[thread overview]
Message-ID: <126e0fe0-a20a-4460-b9b0-19a63d02667b@oracle.com> (raw)
In-Reply-To: <20250822-nfs-testing-v2-1-5f6034b16e46@kernel.org>

On 8/22/25 9:19 AM, Jeff Layton wrote:
> KERN_CONT hails from a simpler time, when SMP wasn't the norm. These
> days, it doesn't quite work right since another printk() can always race
> in between the first one and the one being "continued".
> 
> Nothing calls dprintk_rcu_cont(), so just remove it. The only caller of
> dprintk_cont() is in nfs_commit_release_pages(). Just use a normal
> dprintk() there instead, since this is not SMP-safe anyway.
> 
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>  fs/nfs/write.c               |  6 +++---
>  include/linux/sunrpc/debug.h | 24 ++----------------------
>  2 files changed, 5 insertions(+), 25 deletions(-)
> 
> diff --git a/fs/nfs/write.c b/fs/nfs/write.c
> index d881486d235ba042feedd2dd59d6a60b366b9600..4d5699b4a1fabff39e67998af40561620b532db6 100644
> --- a/fs/nfs/write.c
> +++ b/fs/nfs/write.c
> @@ -1862,7 +1862,7 @@ static void nfs_commit_release_pages(struct nfs_commit_data *data)
>  				nfs_mapping_set_error(folio, status);
>  				nfs_inode_remove_request(req);
>  			}
> -			dprintk_cont(", error = %d\n", status);
> +			dprintk(", error = %d\n", status);
>  			goto next;
>  		}
>  
> @@ -1872,11 +1872,11 @@ static void nfs_commit_release_pages(struct nfs_commit_data *data)
>  			/* We have a match */
>  			if (folio)
>  				nfs_inode_remove_request(req);
> -			dprintk_cont(" OK\n");
> +			dprintk(" OK\n");
>  			goto next;
>  		}
>  		/* We have a mismatch. Write the page again */
> -		dprintk_cont(" mismatch\n");
> +		dprintk(" mismatch\n");
>  		nfs_mark_request_dirty(req);
>  		atomic_long_inc(&NFS_I(data->inode)->redirtied_pages);
>  	next:
> diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h
> index f6aeed07fe04e3d51d7f9d23b10fe86d36241b45..99a6fa4a1d6af0b275546a53957f07c9a509f2ac 100644
> --- a/include/linux/sunrpc/debug.h
> +++ b/include/linux/sunrpc/debug.h
> @@ -23,12 +23,8 @@ extern unsigned int		nlm_debug;
>  
>  #define dprintk(fmt, ...)						\
>  	dfprintk(FACILITY, fmt, ##__VA_ARGS__)
> -#define dprintk_cont(fmt, ...)						\
> -	dfprintk_cont(FACILITY, fmt, ##__VA_ARGS__)
>  #define dprintk_rcu(fmt, ...)						\
>  	dfprintk_rcu(FACILITY, fmt, ##__VA_ARGS__)
> -#define dprintk_rcu_cont(fmt, ...)					\
> -	dfprintk_rcu_cont(FACILITY, fmt, ##__VA_ARGS__)
>  
>  #undef ifdebug
>  #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
> @@ -37,29 +33,14 @@ extern unsigned int		nlm_debug;
>  # define dfprintk(fac, fmt, ...)					\
>  do {									\
>  	ifdebug(fac)							\
> -		printk(KERN_DEFAULT fmt, ##__VA_ARGS__);		\
> -} while (0)
> -
> -# define dfprintk_cont(fac, fmt, ...)					\
> -do {									\
> -	ifdebug(fac)							\
> -		printk(KERN_CONT fmt, ##__VA_ARGS__);			\
> +		printk(KERN_DEFAULT fmt, ##__VA_ARGS__);				\
>  } while (0)
>  
>  # define dfprintk_rcu(fac, fmt, ...)					\
>  do {									\
>  	ifdebug(fac) {							\
>  		rcu_read_lock();					\
> -		printk(KERN_DEFAULT fmt, ##__VA_ARGS__);		\
> -		rcu_read_unlock();					\
> -	}								\
> -} while (0)
> -
> -# define dfprintk_rcu_cont(fac, fmt, ...)				\
> -do {									\
> -	ifdebug(fac) {							\
> -		rcu_read_lock();					\
> -		printk(KERN_CONT fmt, ##__VA_ARGS__);			\
> +		printk(KERN_DEFAULT fmt, ##__VA_ARGS__);				\
>  		rcu_read_unlock();					\
>  	}								\
>  } while (0)
> @@ -68,7 +49,6 @@ do {									\
>  #else
>  # define ifdebug(fac)		if (0)
>  # define dfprintk(fac, fmt, ...)	do {} while (0)
> -# define dfprintk_cont(fac, fmt, ...)	do {} while (0)
>  # define dfprintk_rcu(fac, fmt, ...)	do {} while (0)
>  # define RPC_IFDEBUG(x)
>  #endif
> 

Reviewed-by: Chuck Lever <chuck.lever@oracle.com>

-- 
Chuck Lever

  parent reply	other threads:[~2025-08-27 14:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-22 13:19 [PATCH v2 0/2] sunrpc: allow dprintk() to go to the trace buffer instead of console Jeff Layton
2025-08-22 13:19 ` [PATCH v2 1/2] sunrpc: remove dfprintk_cont() and dfprintk_rcu_cont() Jeff Layton
2025-08-27 14:23   ` Simon Horman
2025-08-27 14:41   ` Chuck Lever [this message]
2025-08-22 13:19 ` [PATCH v2 2/2] sunrpc: add a Kconfig option to redirect dfprintk() output to trace buffer Jeff Layton
2025-08-27 14:24   ` Simon Horman
2025-08-27 14:43   ` Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=126e0fe0-a20a-4460-b9b0-19a63d02667b@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=Dai.Ngo@oracle.com \
    --cc=anna@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jlayton@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neil@brown.name \
    --cc=netdev@vger.kernel.org \
    --cc=okorniev@redhat.com \
    --cc=pabeni@redhat.com \
    --cc=tom@talpey.com \
    --cc=trondmy@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox