mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Brian Gerst <bgerst@didntduck.org>
To: Andrey Panin <pazke@orbita1.ru>
Cc: linux-kernel@vger.kernel.org, Linus Torvalds <torvalds@transmeta.com>
Subject: Re: [PATCH] kernel/rcupdate.c microcleanup
Date: Tue, 11 Mar 2003 10:23:01 -0500	[thread overview]
Message-ID: <3E6DFF55.5070908@didntduck.org> (raw)
In-Reply-To: <20030311140249.GB756@pazke>

Andrey Panin wrote:
> Hi all,
> 
> attached patch (2.5.64) contains small cleanup of RCU code:
>     - move smp_processor_id() outside of irq disabled region in call_rcu();
>     - consolidate multiple spin_unlock() in the rcu_check_quiescent_state(),
>       remove some unneeded {} and make this function inline.
> 
> Tested and works (at least doesn't crash). Please consider applying.
> 
> Best regards.
> 
> 
> 
> ------------------------------------------------------------------------
> 
> diff -urN -X /usr/share/dontdiff linux-2.5.64.vanilla/kernel/rcupdate.c linux-2.5.64/kernel/rcupdate.c
> --- linux-2.5.64.vanilla/kernel/rcupdate.c	Thu Nov 28 01:35:46 2002
> +++ linux-2.5.64/kernel/rcupdate.c	Mon Mar 10 20:18:48 2003
> @@ -67,13 +67,12 @@
>   */
>  void call_rcu(struct rcu_head *head, void (*func)(void *arg), void *arg)
>  {
> -	int cpu;
> +	int cpu = smp_processor_id();
>  	unsigned long flags;
>  
>  	head->func = func;
>  	head->arg = arg;
>  	local_irq_save(flags);
> -	cpu = smp_processor_id();
>  	list_add_tail(&head->list, &RCU_nxtlist(cpu));
>  	local_irq_restore(flags);
>  }

This is not preempt-safe.  smp_processor_id() can only be used in a 
preempt-disabled region (which local_irq_save() provides).

--
				Brian Gerst


  reply	other threads:[~2003-03-11 15:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-11 14:02 Andrey Panin
2003-03-11 15:23 ` Brian Gerst [this message]
2003-03-11 16:44 ` Linus Torvalds

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=3E6DFF55.5070908@didntduck.org \
    --to=bgerst@didntduck.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pazke@orbita1.ru \
    --cc=torvalds@transmeta.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®