mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: linas@austin.ibm.com
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: paulus@au1.ibm.com, Paul Mackerras <paulus@samba.org>,
	linuxppc64-dev <linuxppc64-dev@lists.linuxppc.org>,
	Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: [PATCH] 2.6 PPC64: lockfix for rtas error log (third-times-a-charm?)
Date: Wed, 30 Jun 2004 15:31:20 -0500	[thread overview]
Message-ID: <20040630153120.W21634@forte.austin.ibm.com> (raw)
In-Reply-To: <1088621248.1920.43.camel@gaston>; from benh@kernel.crashing.org on Wed, Jun 30, 2004 at 01:47:29PM -0500

On Wed, Jun 30, 2004 at 01:47:29PM -0500, Benjamin Herrenschmidt wrote:
> 
> > Well, the problem was that there is no lock that is protecting the
> > use of the single, global buffer.  Adding yet another lock is bad;
> > it makes hunting for deadlocks that much more tedious and difficult;
> > already, finding deadlocks is error-prone, and subject to bit-rot as
> > future hackers update the code.  So instead, the problem can be easily
> > avoided by not using a global buffer.  The code below mallocs/frees.
> > Its not perf-critcal, so I don't mind malloc overhead.  Would this
> > work for you?  Patch attached below.
> 
> I prefer that, but couldn't we move the kmalloc outside of the spinlock
> and so use GFP_KERNEL instead ?

OK,

Upon closer analysis of the code, I see that log_rtas_error() 
was incorrectly named, and was being used incorrectly.  The 
solution is to get rid of it entirely; see patch below. So:

-- In one case kmalloc must be GFP_ATOMIC because rtas_call()
   can happen in any context, incl. irqs.
-- In the other case, I turned it into GFP_KENREL, at the cost
   of doing a needless malloc/free in the vast majority of 
   cases where there is no error.  Small price, as I beleive
   that this routine is very rarely called.

Patch below, 
Signed-off-by: Linas Vepstas <linas@linas.org>

--linas


  parent reply	other threads:[~2004-07-01  0:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-29 22:50 [PATCH] PPC64: lockfix for rtas error log linas
2004-06-30  1:17 ` David Gibson
2004-06-30 16:58   ` linas
2004-06-30  1:44 ` Benjamin Herrenschmidt
2004-06-30 17:36   ` linas
2004-06-30 18:47     ` Benjamin Herrenschmidt
2004-06-30 19:02       ` Olof Johansson
2004-06-30 19:02         ` Benjamin Herrenschmidt
2004-06-30 20:31       ` linas [this message]
2004-06-30 11:27 ` Paul Mackerras
2004-06-30 17:50   ` linas
2004-06-30 23:07     ` Paul Mackerras
2004-07-01 16:31       ` Jake Moilanen
2004-07-01 19:19 [PATCH] 2.6 PPC64: lockfix for rtas error log (third-times-a-charm?)] linas
2004-07-01 19:49 ` Dave Hansen
2004-07-01 20:31   ` linas
2004-07-01 20:39     ` Greg KH
2004-07-01 21:17       ` linas

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=20040630153120.W21634@forte.austin.ibm.com \
    --to=linas@austin.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc64-dev@lists.linuxppc.org \
    --cc=paulus@au1.ibm.com \
    --cc=paulus@samba.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

all inboxes | Powered by JetHome®