linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-nvme@lists.infradead.org, corbet@lwn.net,
	rmk+kernel@arm.linux.org.uk, keith.busch@intel.com, axboe@fb.com,
	benh@kernel.crashing.org, mpe@ellerman.id.au,
	k.kozlowski@samsung.com
Subject: Re: [PATCH v4 0/3] dma-mapping, powerpc, nvme: introduce the DMA_ATTR_NO_WARN attribute
Date: Mon, 8 Aug 2016 10:38:17 -0300	[thread overview]
Message-ID: <57A88B49.7080406@linux.vnet.ibm.com> (raw)
In-Reply-To: <20160805100108.8f09fb7c1e63cd4ca06b16bd@linux-foundation.org>

On 08/05/2016 02:01 PM, Andrew Morton wrote:
> Bah.  What about WARN__ON_ONCE()?  Or much heavier ratelimiting?

The problem w/ the WARN_ON_ONCE macro for this case is that it applies
once per _function_ (because of its static variable), not per _device_.

So, after the message happens for a particular device, it won't happen
for any other devices.  This would still conflict with the reasons the
other patch (use dynamic debug) was rejected [1].

The other problem w/ WARN_ON_ONCE (even if it could be used per device)
is that it masks/hides some events:  if you reach it with requests that
are OK to fail (i.e., retry), it will be silent for requests that are
not OK to fail (e.g., the blk_integrity-related call on nvme) -- and it
could be helpful for debugging.

I believe that ratelimiting would fall into the same category as above
(masks events since it hits the threshold with the OK-to-fail requests,
and then misses the not-OK-to-fail requests).

The other problem with ratelimiting would be, in case of continuously
working on high loads with the devices (e.g., nvme drive) - which is
acceptable - the messages would still eventually be printed, and since
it will happen every time the threshold is OK to print it again, it's
only a repetition with a greater period.



... the difficult point with the problem this patch addresses is not
to be heavy handed;  it's interesting to find some balance to still
reach the message when it might be useful, and provide some form of
control to the device driver (for when it knows it is OK for requests
to fail).  Given that the driver can have multiple callsites (with
different or no failure handling), unfortunately I found it hard to
make this arch-specific (but that is what I really aimed for first).

If you see other approaches that could help with it, I'd be happy to
write something simpler/more discreet.

Thanks for the suggestions and discussions.

[1] https://lists.ozlabs.org/pipermail/linuxppc-dev/2016-June/144196.html

-- 
Mauricio Faria de Oliveira
IBM Linux Technology Center

      reply	other threads:[~2016-08-08 13:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-01 22:59 [PATCH v4 0/3] dma-mapping, powerpc, nvme: introduce the DMA_ATTR_NO_WARN attribute Mauricio Faria de Oliveira
2016-08-01 22:59 ` [PATCH 1/3] dma-mapping: " Mauricio Faria de Oliveira
2016-08-01 22:59 ` [PATCH 2/3] powerpc: implement " Mauricio Faria de Oliveira
2016-08-01 22:59 ` [PATCH 3/3] nvme: use " Mauricio Faria de Oliveira
2016-08-04 22:01 ` [PATCH v4 0/3] dma-mapping, powerpc, nvme: introduce " Andrew Morton
2016-08-05  0:17   ` Mauricio Faria de Oliveira
2016-08-05  1:05     ` Andrew Morton
2016-08-05 12:34       ` Mauricio Faria de Oliveira
2016-08-05 17:01         ` Andrew Morton
2016-08-08 13:38           ` Mauricio Faria de Oliveira [this message]

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=57A88B49.7080406@linux.vnet.ibm.com \
    --to=mauricfo@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@fb.com \
    --cc=benh@kernel.crashing.org \
    --cc=corbet@lwn.net \
    --cc=k.kozlowski@samsung.com \
    --cc=keith.busch@intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=mpe@ellerman.id.au \
    --cc=rmk+kernel@arm.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).