mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: paulmck@linux.vnet.ibm.com
Cc: Julia Lawall <julia.lawall@lip6.fr>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Andy Whitcroft <apw@shadowen.org>,
	LKML <linux-kernel@vger.kernel.org>,
	benoit.taine@lip6.fr
Subject: Re: [RFC PATCH] checkpatch: Attempt to find unnecessary 'out of memory' messages
Date: Wed, 18 Jun 2014 12:49:42 -0700	[thread overview]
Message-ID: <1403120982.3839.25.camel@joe-AO725> (raw)
In-Reply-To: <20140618193345.GR4669@linux.vnet.ibm.com>

On Wed, 2014-06-18 at 12:33 -0700, Paul E. McKenney wrote:
> On Sat, Jun 14, 2014 at 11:51:41AM +0200, Julia Lawall wrote:
> > On Sat, 14 Jun 2014, Julia Lawall wrote:
> > > With a semantic patch that searches for the various calls and then a 
> > > string containing the letters "emory", I get removals of the messages 
> > > below.  Do any of these messages look useful?  For example, some are 
> > > generated with specific functions, such as IRDA_ERROR or BT_ERR.  If none 
> > > of the messages look useful, should just one big patch go to trivial, or 
> > > should the patches go to the individual maintainers?
> > 
> > Sorry, I left out all the strings...
> 
> I would like the rcu-torture message to stay:
> 
> > -		pr_err("rcu-torture: Out of memory, need: %d", size);
> 
> This is in a module that is not loaded into any reasonable production
> kernel, and has helped me to catch typos.

I believe the function doesn't work well.

static void
rcu_torture_stats_print(void)
{
	int size = nr_cpu_ids * 200 + 8192;
	char *buf;

	buf = kmalloc(size, GFP_KERNEL);
	if (!buf) {
		pr_err("rcu-torture: Out of memory, need: %d\n", size);
		return;
	}
	rcu_torture_printk(buf);
	pr_alert("%s", buf);
	kfree(buf);
}

rcu_torture_printk simply fills buf

btw: I believe the arguments should pass size and
     rcu_torture_printk should use snprintf/size

but all printks are limited to a maximum of 1024
bytes so the large allocation is senseless and
would even if it worked, would likely need to be
vmalloc/vfree




  reply	other threads:[~2014-06-18 19:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-10 16:55 Joe Perches
2014-06-11  7:47 ` Dan Carpenter
2014-06-11 16:01   ` Joe Perches
2014-06-14  7:40     ` Julia Lawall
2014-06-14  8:30       ` Joe Perches
2014-06-14  9:51       ` Julia Lawall
2014-06-18 19:33         ` Paul E. McKenney
2014-06-18 19:49           ` Joe Perches [this message]
2014-06-19 21:00             ` Paul E. McKenney
2014-06-19 23:24               ` [RFC PATCH] use snprintf instead of sprintf in rcu_torture_printk Pranith Kumar
2014-06-19 23:33                 ` Joe Perches
2014-06-20  0:11                   ` Pranith Kumar
2014-06-19 23:49                 ` Paul E. McKenney
2014-06-20  0:13                   ` Pranith Kumar
2014-06-20  4:54                     ` Paul E. McKenney
2014-06-20 22:04                       ` Joe Perches
2014-06-18 21:18           ` [RFC PATCH] checkpatch: Attempt to find unnecessary 'out of memory' messages Julia Lawall

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=1403120982.3839.25.camel@joe-AO725 \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=apw@shadowen.org \
    --cc=benoit.taine@lip6.fr \
    --cc=dan.carpenter@oracle.com \
    --cc=julia.lawall@lip6.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    /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

all inboxes | Powered by JetHome®