All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@sun.com>
To: Mingming Cao <cmm@us.ibm.com>
Cc: ext4 development <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH][RFC]Ext4: Use get_cpu()/put_cpu() in preemptible context
Date: Sat, 3 Nov 2007 13:01:37 +0800	[thread overview]
Message-ID: <20071103050137.GE2863@webber.adilger.int> (raw)
In-Reply-To: <1194050108.3966.18.camel@localhost.localdomain>

On Nov 02, 2007  17:35 -0700, Mingming Cao wrote:
> Index: linux-2.6.24-rc1/fs/ext4/mballoc.c
> ===================================================================
> --- linux-2.6.24-rc1.orig/fs/ext4/mballoc.c	2007-11-02 17:22:18.000000000 -0700
> +++ linux-2.6.24-rc1/fs/ext4/mballoc.c	2007-11-02 17:23:02.000000000 -0700
> @@ -4006,7 +4006,8 @@ static void ext4_mb_group_or_file(struct
>  		return;
>  
>  	BUG_ON(ac->ac_lg != NULL);
> -	ac->ac_lg = &sbi->s_locality_groups[smp_processor_id()];
> +	ac->ac_lg = &sbi->s_locality_groups[get_cpu()];
> +	put_cpu();
>  
>  	/* we're going to use group allocation */
>  	ac->ac_flags |= EXT4_MB_HINT_GROUP_ALLOC;

Shouldn't the put_cpu() be after ac->ac_lg is no longer being used?
I guess there would otherwise be a danger of other processes using
the same s_locality_groups[] struct?

Cheers, Andreas
--
Andreas Dilger
Sr. Software Engineer, Lustre Group
Sun Microsystems of Canada, Inc.

  reply	other threads:[~2007-11-03  5:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1Inx4A-0002PQ-00@kernel>
     [not found] ` <1194044898.3966.6.camel@localhost.localdomain>
     [not found]   ` <472BB037.5010606@linux.vnet.ibm.com>
2007-11-03  0:35     ` [PATCH][RFC]Ext4: Use get_cpu()/put_cpu() in preemptible context Mingming Cao
2007-11-03  5:01       ` Andreas Dilger [this message]
2007-11-05 18:40         ` Mingming Cao

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=20071103050137.GE2863@webber.adilger.int \
    --to=adilger@sun.com \
    --cc=cmm@us.ibm.com \
    --cc=linux-ext4@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.