All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Young <dyoung@redhat.com>
To: Tejun Heo <tj@kernel.org>
Cc: WANG Cong <xiyou.wangcong@gmail.com>,
	kexec@lists.infradead.org, tim@edgecast.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] percpu: fix chunk range calculation
Date: Tue, 22 Nov 2011 10:48:28 +0800	[thread overview]
Message-ID: <4ECB0D7C.1020700@redhat.com> (raw)
In-Reply-To: <20111121211050.GK25776@google.com>

On 11/22/2011 05:10 AM, Tejun Heo wrote:

> On Fri, Nov 18, 2011 at 10:55:35AM -0800, Tejun Heo wrote:
>> Percpu allocator recorded the cpus which map to the first and last
>> units in pcpu_first/last_unit_cpu respectively and used them to
>> determine the address range of a chunk - e.g. it assumed that the
>> first unit has the lowest address in a chunk while the last unit has
>> the highest address.
>>
>> This simply isn't true.  Groups in a chunk can have arbitrary positive
>> or negative offsets from the previous one and there is no guarantee
>> that the first unit occupies the lowest offset while the last one the
>> highest.
>>
>> Fix it by actually comparing unit offsets to determine cpus occupying
>> the lowest and highest offsets.  Also, rename pcu_first/last_unit_cpu
>> to pcpu_low/high_unit_cpu to avoid confusion.
>>
>> The chunk address range is used to flush cache on vmalloc area
>> map/unmap and decide whether a given address is in the first chunk by
>> per_cpu_ptr_to_phys() and the bug was discovered by invalid
>> per_cpu_ptr_to_phys() translation for crash_note.
>>
>> Kudos to Dave Young for tracking down the problem.
>>
>> Signed-off-by: Tejun Heo <tj@kernel.org>
>> Reported-by: WANG Cong <xiyou.wangcong@gmail.com>
>> Reported-by: Dave Young <dyoung@redhat.com>
>> LKML-Reference: <4EC21F67.10905@redhat.com>
>> Cc: stable @kernel.org
> 
> BTW, waiting for Tested-by.  If someone gives me that, I'll push it
> through percpu/for-fixes.


Tested-by: Dave Young <dyoung@redhat.com>

> 
> Thanks.
> 



-- 
Thanks
Dave

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

WARNING: multiple messages have this Message-ID (diff)
From: Dave Young <dyoung@redhat.com>
To: Tejun Heo <tj@kernel.org>
Cc: WANG Cong <xiyou.wangcong@gmail.com>,
	kexec@lists.infradead.org, tim@edgecast.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] percpu: fix chunk range calculation
Date: Tue, 22 Nov 2011 10:48:28 +0800	[thread overview]
Message-ID: <4ECB0D7C.1020700@redhat.com> (raw)
In-Reply-To: <20111121211050.GK25776@google.com>

On 11/22/2011 05:10 AM, Tejun Heo wrote:

> On Fri, Nov 18, 2011 at 10:55:35AM -0800, Tejun Heo wrote:
>> Percpu allocator recorded the cpus which map to the first and last
>> units in pcpu_first/last_unit_cpu respectively and used them to
>> determine the address range of a chunk - e.g. it assumed that the
>> first unit has the lowest address in a chunk while the last unit has
>> the highest address.
>>
>> This simply isn't true.  Groups in a chunk can have arbitrary positive
>> or negative offsets from the previous one and there is no guarantee
>> that the first unit occupies the lowest offset while the last one the
>> highest.
>>
>> Fix it by actually comparing unit offsets to determine cpus occupying
>> the lowest and highest offsets.  Also, rename pcu_first/last_unit_cpu
>> to pcpu_low/high_unit_cpu to avoid confusion.
>>
>> The chunk address range is used to flush cache on vmalloc area
>> map/unmap and decide whether a given address is in the first chunk by
>> per_cpu_ptr_to_phys() and the bug was discovered by invalid
>> per_cpu_ptr_to_phys() translation for crash_note.
>>
>> Kudos to Dave Young for tracking down the problem.
>>
>> Signed-off-by: Tejun Heo <tj@kernel.org>
>> Reported-by: WANG Cong <xiyou.wangcong@gmail.com>
>> Reported-by: Dave Young <dyoung@redhat.com>
>> LKML-Reference: <4EC21F67.10905@redhat.com>
>> Cc: stable @kernel.org
> 
> BTW, waiting for Tested-by.  If someone gives me that, I'll push it
> through percpu/for-fixes.


Tested-by: Dave Young <dyoung@redhat.com>

> 
> Thanks.
> 



-- 
Thanks
Dave

  reply	other threads:[~2011-11-22  2:46 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-11 23:39 Crash during vmcore_init Tim Hartrick
2011-11-14 13:39 ` WANG Cong
2011-11-14 18:50   ` Tim Hartrick
2011-11-15  8:14     ` Dave Young
2011-11-15  8:14       ` Dave Young
2011-11-15 13:47       ` Américo Wang
2011-11-15 13:47         ` Américo Wang
2011-11-15 13:50         ` Américo Wang
2011-11-15 13:50           ` Américo Wang
2011-11-15 22:32       ` Tim Hartrick
2011-11-15 22:32         ` Tim Hartrick
2011-11-16  2:22         ` Dave Young
2011-11-16  2:22           ` Dave Young
2011-11-16 18:20           ` Tim Hartrick
2011-11-16 18:20             ` Tim Hartrick
2011-11-17  3:30             ` Dave Young
2011-11-17  3:30               ` Dave Young
2011-11-17  4:34               ` Tejun Heo
2011-11-17  4:34                 ` Tejun Heo
2011-11-17  4:46                 ` Dave Young
2011-11-17  4:46                   ` Dave Young
2011-11-17  5:22                   ` Tim Hartrick
2011-11-17  7:21                     ` Dave Young
2011-11-17  7:21                       ` Dave Young
2011-11-17  7:23                       ` Tejun Heo
2011-11-17  7:23                         ` Tejun Heo
2011-11-17  7:42                         ` Américo Wang
2011-11-17  7:42                           ` Américo Wang
2011-11-17 16:40                       ` Tim Hartrick
2011-11-17 16:40                         ` Tim Hartrick
2011-11-18  8:43                         ` Dave Young
2011-11-18  8:43                           ` Dave Young
2011-11-18  8:45                           ` Dave Young
2011-11-18  8:45                             ` Dave Young
2011-11-18 18:55                             ` [PATCH] percpu: fix chunk range calculation Tejun Heo
2011-11-18 18:55                               ` Tejun Heo
2011-11-21  1:45                               ` Dave Young
2011-11-21  1:45                                 ` Dave Young
2011-11-21 16:20                                 ` Tim Hartrick
2011-11-22  2:52                                   ` Dave Young
2011-11-22  2:52                                     ` Dave Young
2011-11-21 17:01                                 ` Tejun Heo
2011-11-21 17:01                                   ` Tejun Heo
2011-11-22  3:00                                   ` Dave Young
2011-11-22  3:00                                     ` Dave Young
2011-11-22 16:02                                     ` Tejun Heo
2011-11-22 16:02                                       ` Tejun Heo
2011-11-21 21:10                               ` Tejun Heo
2011-11-21 21:10                                 ` Tejun Heo
2011-11-22  2:48                                 ` Dave Young [this message]
2011-11-22  2:48                                   ` Dave Young
2011-11-22 16:19                                   ` Tejun Heo
2011-11-22 16:19                                     ` Tejun Heo
2011-11-15 14:13     ` Crash during vmcore_init Américo Wang
2011-11-15 22:57       ` Tim Hartrick
2011-11-16 12:47         ` Américo Wang
2011-11-16 13:19           ` Tim Hartrick
2011-11-16 13:31             ` Américo Wang
2011-11-16 13:44               ` Tim Hartrick
     [not found]               ` <1321462343.4198.29.camel@boudreau>
2011-11-17  6:48                 ` Américo Wang
2011-11-17 16:08                   ` Tim Hartrick
2011-11-17 16:31                     ` Tim Hartrick
2011-11-16 15:52           ` Tim Hartrick

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=4ECB0D7C.1020700@redhat.com \
    --to=dyoung@redhat.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tim@edgecast.com \
    --cc=tj@kernel.org \
    --cc=xiyou.wangcong@gmail.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 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.