linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Kyle Moffett <mrmacman_g4@mac.com>
Cc: Joe Perches <joe@perches.com>,
	Randy Dunlap <randy.dunlap@oracle.com>,
	jengelh@computergmbh.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Reduce stack used by lib/hexdump.c
Date: Wed, 5 Dec 2007 23:10:40 -0800	[thread overview]
Message-ID: <20071205231040.f6c9b40e.akpm@linux-foundation.org> (raw)
In-Reply-To: <831AEA99-3615-4015-9415-A4572D690095@mac.com>

On Thu, 6 Dec 2007 00:58:38 -0500 Kyle Moffett <mrmacman_g4@mac.com> wrote:

> On Dec 05, 2007, at 21:42:35, Joe Perches wrote:
> > On Wed, 2007-12-05 at 18:18 -0800, Randy Dunlap wrote:
> >> Joe Perches wrote:
> >>> Maybe just eliminate the 16 or 32 byte width option and force it  
> >>> to only 16 byte widths.
> >> Have you checked users (callers)?  I'm pretty sure that one of the  
> >> callers wanted 32 and that's why it's there.
> >
> > I did.  There is only 1 subsystem.  That's easy to change.
> >
> > drivers/mtd/ubi/debug.c:  print_hex_dump(KERN_DEBUG, "",  
> > DUMP_PREFIX_OFFSET, 32, 1,
> > drivers/mtd/ubi/io.c:     print_hex_dump(KERN_DEBUG, "",  
> > DUMP_PREFIX_OFFSET, 32, 1,
> >
> > Long lines in the log file are not too easy to read anyway.  Using  
> > 16 byte dumps per line instead of 32 isn't painful.
> >
> > It gets rid of the allocation, reduces the argument count and makes  
> > the kernel smaller.  I think it's all good.
> >
> > Every current caller would have to change though.
> 
> Alternatively, since print_hex_dump is not a performance-critical  
> path (and usually indicates an error/debug condition), you could  
> probably just make a static "hexdump_lock" spinlock and  
> spin_lock_irqsave()/spin_unlock_irqrestore().  It would always nest  
> inside any other lock (except during crash, where we break locks  
> already for printk()), and I doubt any of the callers would notice  
> the serialization since they're already serialized on the printk buffer.
> 

Yup, that'd work.

  reply	other threads:[~2007-12-06  7:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-29 18:08 [PATCH] Remove #define hex_asc from kernel.h, update lib/hexdump.c Joe Perches
2007-11-29 18:24 ` Randy Dunlap
2007-11-29 18:44   ` Joe Perches
2007-11-29 18:52     ` Randy Dunlap
2007-11-29 18:55       ` Joe Perches
2007-11-29 20:57       ` [PATCH] Reduce stack used by lib/hexdump.c Joe Perches
2007-11-29 21:02         ` Randy Dunlap
2007-11-29 21:07           ` Jan Engelhardt
2007-11-29 23:28             ` Joe Perches
2007-12-06  0:01               ` Andrew Morton
2007-12-06  2:10                 ` Joe Perches
2007-12-06  2:18                   ` Randy Dunlap
2007-12-06  2:42                     ` Joe Perches
2007-12-06  5:58                       ` Kyle Moffett
2007-12-06  7:10                         ` Andrew Morton [this message]
2007-12-06 21:52                 ` Joe Perches

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=20071205231040.f6c9b40e.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=jengelh@computergmbh.de \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mrmacman_g4@mac.com \
    --cc=randy.dunlap@oracle.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;
as well as URLs for NNTP newsgroup(s).