linux-pwm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Jingoo Han <jg1.han@samsung.com>,
	'Viresh Kumar' <viresh.kumar@linaro.org>,
	'Joe Perches' <joe@perches.com>,
	'Thierry Reding' <thierry.reding@gmail.com>,
	linux-pwm@vger.kernel.org,
	'Andrew Morton' <akpm@linux-foundation.org>
Subject: Re: [PATCH 5/9] pwm: spear: Remove unnecessary OOM messages
Date: Wed, 5 Mar 2014 14:40:06 +0300	[thread overview]
Message-ID: <20140305114005.GA28102@mwanda> (raw)
In-Reply-To: <6028232.VHmxlGjlXi@avalon>

On Wed, Mar 05, 2014 at 12:00:42PM +0100, Laurent Pinchart wrote:
> Hi Dan,
> 
> On Monday 03 March 2014 12:53:11 Dan Carpenter wrote:
> > On Mon, Mar 03, 2014 at 10:14:22AM +0900, Jingoo Han wrote:
> > > On Wednesday, February 26, 2014 3:26 PM, Viresh Kumar wrote:
> > > > On 26 February 2014 10:49, Joe Perches <joe@perches.com> wrote:
> > > > > Look at warn_alloc_failed() in mm/page_alloc.c
> > > > 
> > > > Okay, there is a print there. But I am not able to reach to this routine
> > > > from devm_kzalloc().
> > > > 
> > > > devm_kzalloc() <linux/device.h>
> > > > devm_kmalloc() <drivers/base/devres.c>
> > > > alloc_dr() <drivers/base/devres.c>
> > > > kmalloc_track_caller() <linux/slab.h>
> > > > __kmalloc_track_caller() <mm/slab,slub/slob.c> Taking slab as example:
> > > > __do_kmalloc() <mm/slab.c>
> > > 
> > > (+CC Laurent Pinchart, Dan Carpenter)
> > > 
> > > Right, I also cannot find that warn_alloc_failed() is called, during
> > > devm_kzalloc().
> > > 
> > > However, in the case of vmalloc(), warn_alloc_failed() is called
> > > as below.
> > > 
> > > ./mm/vmalloc.c
> > > vmalloc()
> > > __vmalloc_node_flags()
> > > __vmalloc_node()
> > > __vmalloc_node_range()
> > > 
> > > ./mm/page_alloc.c
> > > warn_alloc_failed()
> > > 
> > > > ...
> > > > 
> > > > I can see cases where NULL is returned after above paths and the
> > > > function you mentioned wasn't there. So, I am not sure that we will get
> > > > a print for sure for any error that might occur from devm_kzalloc().
> > > 
> > > I guess that slab_out_of_memory() <./mm/slub.c> may print it for any
> > > errors. But, I am not sure. :-(
> > 
> > devm_kzalloc() is just kmalloc().  The OOM error messages are the same.
> 
> Sure, but I wasn't sure whether all error code paths in kmalloc() resulted in 
> an OOM message. For instance, the following code path results in an allocation 
> failure but doesn't seem to print an OOM message:
> 
> kmalloc
> __kmalloc
> __do_kmalloc
> slab_alloc
> slab_should_failslab
> should_failslab
> should_fail
> 
> A bit far-fetched possibly as it requires fault injection. I haven't found any 
> other such code path, but my understanding of that code is a bit limited.

should_fail() only returns true after calling fail_dump().

You can pass (GFP_KERNEL | __GFP_NOWARN) if you want to turn off
warnings.  Otherwise it shuold print a warning.

regards,
dan carpenter


  reply	other threads:[~2014-03-05 11:41 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-26  0:59 [PATCH 0/9] pwm: Remove unnecessary OOM messages Jingoo Han
2014-02-26  1:02 ` [PATCH 1/9] pwm: ab8500: " Jingoo Han
2014-02-26  1:04 ` [PATCH 2/9] pwm: i.MX: " Jingoo Han
2014-02-26  1:06 ` [PATCH 3/9] pwm: pxa: " Jingoo Han
2014-02-26  1:08 ` [PATCH 4/9] pwm: renesas-tpu: " Jingoo Han
2014-02-26  2:22   ` Laurent Pinchart
2014-02-26  2:34     ` Jingoo Han
2014-02-26 22:02       ` Laurent Pinchart
2014-02-26  1:09 ` [PATCH 5/9] pwm: spear: " Jingoo Han
2014-02-26  4:49   ` Viresh Kumar
2014-02-26  4:57     ` Jingoo Han
2014-02-26  5:10       ` Viresh Kumar
2014-02-26  5:19         ` Joe Perches
2014-02-26  6:26           ` Viresh Kumar
2014-03-03  1:14             ` Jingoo Han
2014-03-03  9:53               ` Dan Carpenter
2014-03-05 11:00                 ` Laurent Pinchart
2014-03-05 11:40                   ` Dan Carpenter [this message]
2014-03-05 16:17                   ` Viresh Kumar
2014-03-05 16:29                     ` Laurent Pinchart
2014-03-07  8:04                       ` Jingoo Han
2014-03-10 12:22                         ` Thierry Reding
2014-04-03  3:24                           ` Jingoo Han
2014-05-21 10:34                             ` Thierry Reding
2014-02-26  1:10 ` [PATCH 6/9] pwm: tegra: " Jingoo Han
2014-02-26  1:12 ` [PATCH 7/9] pwm: pwm-tiecap: " Jingoo Han
2014-02-26  1:13 ` [PATCH 8/9] pwm: tiehrpwm: " Jingoo Han
2014-02-26  1:14 ` [PATCH 9/9] pwm: vt8500: " Jingoo Han

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=20140305114005.GA28102@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=jg1.han@samsung.com \
    --cc=joe@perches.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-pwm@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=viresh.kumar@linaro.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;
as well as URLs for NNTP newsgroup(s).