linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvme: Print capabilities changes just once
@ 2023-06-13 17:55 Breno Leitao
  2023-06-13 22:00 ` Keith Busch
  0 siblings, 1 reply; 3+ messages in thread
From: Breno Leitao @ 2023-06-13 17:55 UTC (permalink / raw)
  To: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg
  Cc: leit, open list:NVM EXPRESS DRIVER, open list

This current dev_info() could be very verbose and being printed very
frequently depending on some userspace application sending some specific
commands.

Let's turn it into a dev_info_once(), since it is not useful to know
about it all the time.

Signed-off-by: Breno Leitao <leitao@debian.org>
---
 drivers/nvme/host/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 3ec38e2b9173..459e5a84e596 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1134,7 +1134,7 @@ void nvme_passthru_end(struct nvme_ctrl *ctrl, struct nvme_ns *ns, u32 effects,
 		mutex_unlock(&ctrl->scan_lock);
 	}
 	if (effects & NVME_CMD_EFFECTS_CCC) {
-		dev_info(ctrl->device,
+		dev_info_once(ctrl->device,
 "controller capabilities changed, reset may be required to take effect.\n");
 	}
 	if (effects & (NVME_CMD_EFFECTS_NIC | NVME_CMD_EFFECTS_NCC)) {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] nvme: Print capabilities changes just once
  2023-06-13 17:55 [PATCH] nvme: Print capabilities changes just once Breno Leitao
@ 2023-06-13 22:00 ` Keith Busch
  2023-06-14  5:01   ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Keith Busch @ 2023-06-13 22:00 UTC (permalink / raw)
  To: Breno Leitao
  Cc: Jens Axboe, Christoph Hellwig, Sagi Grimberg, leit,
	open list:NVM EXPRESS DRIVER, open list

On Tue, Jun 13, 2023 at 10:55:37AM -0700, Breno Leitao wrote:
> This current dev_info() could be very verbose and being printed very
> frequently depending on some userspace application sending some specific
> commands.
> 
> Let's turn it into a dev_info_once(), since it is not useful to know
> about it all the time.

This looks good to me. Vendors sometimes put unnecessary effects in the
log, and spamming the same recommendation to repeated operations isn't
going to be helpful. I expect anyone who knows what they're doing can
consult the effects log directly and take appropriate action on their
own.

Reviewed-by: Keith Busch <kbusch@kernel.org>
 
> Signed-off-by: Breno Leitao <leitao@debian.org>
> ---
>  drivers/nvme/host/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 3ec38e2b9173..459e5a84e596 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -1134,7 +1134,7 @@ void nvme_passthru_end(struct nvme_ctrl *ctrl, struct nvme_ns *ns, u32 effects,
>  		mutex_unlock(&ctrl->scan_lock);
>  	}
>  	if (effects & NVME_CMD_EFFECTS_CCC) {
> -		dev_info(ctrl->device,
> +		dev_info_once(ctrl->device,
>  "controller capabilities changed, reset may be required to take effect.\n");
>  	}
>  	if (effects & (NVME_CMD_EFFECTS_NIC | NVME_CMD_EFFECTS_NCC)) {
> -- 
> 2.34.1
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] nvme: Print capabilities changes just once
  2023-06-13 22:00 ` Keith Busch
@ 2023-06-14  5:01   ` Christoph Hellwig
  0 siblings, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2023-06-14  5:01 UTC (permalink / raw)
  To: Keith Busch
  Cc: Breno Leitao, Jens Axboe, Christoph Hellwig, Sagi Grimberg, leit,
	open list:NVM EXPRESS DRIVER, open list

On Tue, Jun 13, 2023 at 04:00:58PM -0600, Keith Busch wrote:
> On Tue, Jun 13, 2023 at 10:55:37AM -0700, Breno Leitao wrote:
> > This current dev_info() could be very verbose and being printed very
> > frequently depending on some userspace application sending some specific
> > commands.
> > 
> > Let's turn it into a dev_info_once(), since it is not useful to know
> > about it all the time.
> 
> This looks good to me. Vendors sometimes put unnecessary effects in the
> log, and spamming the same recommendation to repeated operations isn't
> going to be helpful. I expect anyone who knows what they're doing can
> consult the effects log directly and take appropriate action on their
> own.

Hmm, once seems very little.  It might make more sense to do this
once and then skip it until the controller has been reset.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-06-14  5:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-13 17:55 [PATCH] nvme: Print capabilities changes just once Breno Leitao
2023-06-13 22:00 ` Keith Busch
2023-06-14  5:01   ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).