linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dave Young <hidave.darkstar@gmail.com>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: npiggin@suse.de, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, Tejun Heo <tj@kernel.org>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Christoph Lameter <cl@linux-foundation.org>
Subject: Re: [PATCH 1/1] MM: slqb, fix per_cpu access
Date: Mon, 2 Nov 2009 19:48:30 +0800	[thread overview]
Message-ID: <a8e1da0911020348m177420d2gd1aa25bdf8d53b03@mail.gmail.com> (raw)
In-Reply-To: <1257151763-11507-1-git-send-email-jirislaby@gmail.com>

On Mon, Nov 2, 2009 at 4:49 PM, Jiri Slaby <jirislaby@gmail.com> wrote:
> We cannot use the same local variable name as the declared per_cpu
> variable since commit "percpu: remove per_cpu__ prefix."
>
> Otherwise we would see crashes like:
> general protection fault: 0000 [#1] SMP
> last sysfs file:
> CPU 1
> Modules linked in:
> Pid: 1, comm: swapper Tainted: G        W  2.6.32-rc5-mm1_64 #860
> RIP: 0010:[<ffffffff8142ff94>]  [<ffffffff8142ff94>] start_cpu_timer+0x2b/0x87
> ...
>
> Use slqb_ prefix for the global variable so that we don't collide
> even with the rest of the kernel (s390 and alpha need this).
>
> Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
> Cc: Nick Piggin <npiggin@suse.de>
> Cc: Tejun Heo <tj@kernel.org>
> Cc: Rusty Russell <rusty@rustcorp.com.au>
> Cc: Christoph Lameter <cl@linux-foundation.org>

Tested-by: Dave Young <hidave.darkstar@gmail.com>

> ---
>  mm/slqb.c |   10 ++++++----
>  1 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/mm/slqb.c b/mm/slqb.c
> index e745d9a..e4bb53f 100644
> --- a/mm/slqb.c
> +++ b/mm/slqb.c
> @@ -2766,11 +2766,12 @@ out:
>        schedule_delayed_work(work, round_jiffies_relative(3*HZ));
>  }
>
> -static DEFINE_PER_CPU(struct delayed_work, cache_trim_work);
> +static DEFINE_PER_CPU(struct delayed_work, slqb_cache_trim_work);
>
>  static void __cpuinit start_cpu_timer(int cpu)
>  {
> -       struct delayed_work *cache_trim_work = &per_cpu(cache_trim_work, cpu);
> +       struct delayed_work *cache_trim_work = &per_cpu(slqb_cache_trim_work,
> +                       cpu);
>
>        /*
>         * When this gets called from do_initcalls via cpucache_init(),
> @@ -3136,8 +3137,9 @@ static int __cpuinit slab_cpuup_callback(struct notifier_block *nfb,
>
>        case CPU_DOWN_PREPARE:
>        case CPU_DOWN_PREPARE_FROZEN:
> -               cancel_rearming_delayed_work(&per_cpu(cache_trim_work, cpu));
> -               per_cpu(cache_trim_work, cpu).work.func = NULL;
> +               cancel_rearming_delayed_work(&per_cpu(slqb_cache_trim_work,
> +                                       cpu));
> +               per_cpu(slqb_cache_trim_work, cpu).work.func = NULL;
>                break;
>
>        case CPU_UP_CANCELED:
> --
> 1.6.4.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>



-- 
Regards
dave

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2009-11-02 11:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-01 22:12 Jiri Slaby
2009-11-02  4:22 ` Tejun Heo
2009-11-02  8:49   ` Jiri Slaby
2009-11-02 11:48     ` Dave Young [this message]
2009-11-02 15:24     ` Tejun Heo
2009-11-02 16:24     ` Christoph Lameter
2009-11-02 13:23 ` Rusty Russell
2009-11-02 15:31   ` Jiri Slaby
2009-11-04  7:45     ` Rusty Russell

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=a8e1da0911020348m177420d2gd1aa25bdf8d53b03@mail.gmail.com \
    --to=hidave.darkstar@gmail.com \
    --cc=cl@linux-foundation.org \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=npiggin@suse.de \
    --cc=rusty@rustcorp.com.au \
    --cc=tj@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox