* [PATCH] mm/page_alloc.c: fix a typo
@ 2008-05-06 9:38 Li Zefan
2008-05-06 9:41 ` Li Zefan
2008-05-06 18:18 ` Oliver Pinter
0 siblings, 2 replies; 11+ messages in thread
From: Li Zefan @ 2008-05-06 9:38 UTC (permalink / raw)
To: Andrew Morton; +Cc: clameter, LKML, linux-mm
---
mm/page_alloc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index bdd5c43..d0ba10d 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -303,7 +303,7 @@ static void destroy_compound_page(struct page *page, unsigned long order)
for (i = 1; i < nr_pages; i++) {
struct page *p = page + i;
- if (unlikely(!PageTail(p) |
+ if (unlikely(!PageTail(p) ||
(p->first_page != page)))
bad_page(page);
__ClearPageTail(p);
-- 1.5.4.rc3
--
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>
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH] mm/page_alloc.c: fix a typo
2008-05-06 9:38 [PATCH] mm/page_alloc.c: fix a typo Li Zefan
@ 2008-05-06 9:41 ` Li Zefan
2008-05-06 9:50 ` Li Zefan
2008-05-06 18:18 ` Oliver Pinter
1 sibling, 1 reply; 11+ messages in thread
From: Li Zefan @ 2008-05-06 9:41 UTC (permalink / raw)
To: Andrew Morton; +Cc: clameter, LKML, linux-mm
---
mm/page_alloc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index bdd5c43..d0ba10d 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -303,7 +303,7 @@ static void destroy_compound_page(struct page *page, unsigned long order)
for (i = 1; i < nr_pages; i++) {
struct page *p = page + i;
- if (unlikely(!PageTail(p) |
+ if (unlikely(!PageTail(p) ||
(p->first_page != page)))
bad_page(page);
__ClearPageTail(p);
-- 1.5.4.rc3
--
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>
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH] mm/page_alloc.c: fix a typo
2008-05-06 9:41 ` Li Zefan
@ 2008-05-06 9:50 ` Li Zefan
2008-05-06 14:19 ` Andrew Morton
2008-05-06 17:51 ` Christoph Lameter
0 siblings, 2 replies; 11+ messages in thread
From: Li Zefan @ 2008-05-06 9:50 UTC (permalink / raw)
To: Andrew Morton; +Cc: clameter, LKML, linux-mm
Li Zefan wrote:
> ---
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
Sorry for the noise, but the signed-off was eaten. :(
Maybe I should leave a blank line before the signed-off.
---
mm/page_alloc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index bdd5c43..d0ba10d 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -303,7 +303,7 @@ static void destroy_compound_page(struct page *page, unsigned long order)
for (i = 1; i < nr_pages; i++) {
struct page *p = page + i;
- if (unlikely(!PageTail(p) |
+ if (unlikely(!PageTail(p) ||
(p->first_page != page)))
bad_page(page);
__ClearPageTail(p);
-- 1.5.4.rc3
--
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>
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH] mm/page_alloc.c: fix a typo
2008-05-06 9:50 ` Li Zefan
@ 2008-05-06 14:19 ` Andrew Morton
2008-05-07 1:27 ` Li Zefan
2008-05-06 17:51 ` Christoph Lameter
1 sibling, 1 reply; 11+ messages in thread
From: Andrew Morton @ 2008-05-06 14:19 UTC (permalink / raw)
To: Li Zefan; +Cc: clameter, LKML, linux-mm
On Tue, 06 May 2008 17:50:31 +0800 Li Zefan <lizf@cn.fujitsu.com> wrote:
> Li Zefan wrote:
> > ---
>
> Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
> ---
>
> Sorry for the noise, but the signed-off was eaten. :(
> Maybe I should leave a blank line before the signed-off.
>
> ---
>
> mm/page_alloc.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index bdd5c43..d0ba10d 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -303,7 +303,7 @@ static void destroy_compound_page(struct page *page, unsigned long order)
> for (i = 1; i < nr_pages; i++) {
> struct page *p = page + i;
>
> - if (unlikely(!PageTail(p) |
> + if (unlikely(!PageTail(p) ||
> (p->first_page != page)))
> bad_page(page);
> __ClearPageTail(p);
I have a vague memory that the "|" was deliberate. Most of the time,
"!PageTail" will be false so most of the time we won't take the first
branch so it's probably worth omitting it and always doing the pointer
comparison.
It's a somewhat dopey trick and shouldn't have been done without a comment.
otoh maybe it was a typo.
--
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>
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH] mm/page_alloc.c: fix a typo
2008-05-06 14:19 ` Andrew Morton
@ 2008-05-07 1:27 ` Li Zefan
2008-05-07 4:32 ` Li Zefan
0 siblings, 1 reply; 11+ messages in thread
From: Li Zefan @ 2008-05-07 1:27 UTC (permalink / raw)
To: Andrew Morton; +Cc: clameter, LKML, linux-mm
Andrew Morton wrote:
> On Tue, 06 May 2008 17:50:31 +0800 Li Zefan <lizf@cn.fujitsu.com> wrote:
>
>> Li Zefan wrote:
>>> ---
>> Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
>> ---
>>
>> Sorry for the noise, but the signed-off was eaten. :(
>> Maybe I should leave a blank line before the signed-off.
>>
>> ---
>>
>> mm/page_alloc.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
>> index bdd5c43..d0ba10d 100644
>> --- a/mm/page_alloc.c
>> +++ b/mm/page_alloc.c
>> @@ -303,7 +303,7 @@ static void destroy_compound_page(struct page *page, unsigned long order)
>> for (i = 1; i < nr_pages; i++) {
>> struct page *p = page + i;
>>
>> - if (unlikely(!PageTail(p) |
>> + if (unlikely(!PageTail(p) ||
>> (p->first_page != page)))
>> bad_page(page);
>> __ClearPageTail(p);
>
> I have a vague memory that the "|" was deliberate. Most of the time,
> "!PageTail" will be false so most of the time we won't take the first
!PageTail will be true if nothing bad happened, corrected me if I'm wrong:
static void prep_compound_page(struct page *page, unsigned long order)
{
...
for (i = 1; i < nr_pages; i++) {
struct page *p = page + i;
__SetPageTail(p);
p->first_page = page;
}
}
> branch so it's probably worth omitting it and always doing the pointer
> comparison.
>
> It's a somewhat dopey trick and shouldn't have been done without a comment.
>
> otoh maybe it was a typo.
>
>
--
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>
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH] mm/page_alloc.c: fix a typo
2008-05-07 1:27 ` Li Zefan
@ 2008-05-07 4:32 ` Li Zefan
0 siblings, 0 replies; 11+ messages in thread
From: Li Zefan @ 2008-05-07 4:32 UTC (permalink / raw)
To: Andrew Morton; +Cc: clameter, LKML, linux-mm
Li Zefan wrote:
>>> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
>>> index bdd5c43..d0ba10d 100644
>>> --- a/mm/page_alloc.c
>>> +++ b/mm/page_alloc.c
>>> @@ -303,7 +303,7 @@ static void destroy_compound_page(struct page *page, unsigned long order)
>>> for (i = 1; i < nr_pages; i++) {
>>> struct page *p = page + i;
>>>
>>> - if (unlikely(!PageTail(p) |
>>> + if (unlikely(!PageTail(p) ||
>>> (p->first_page != page)))
>>> bad_page(page);
>>> __ClearPageTail(p);
>> I have a vague memory that the "|" was deliberate. Most of the time,
>> "!PageTail" will be false so most of the time we won't take the first
>
> !PageTail will be true if nothing bad happened, corrected me if I'm wrong:
>
Silly, I was wrong...
Christoph Lameter wrote:
> I think the | there was some developers attempt to avoid gcc generating
> too many branches. I am fine either way.
>
Yes, I found out it's 224abf92b2f439a9030f21d2926ec8047d1ffcdb :
[PATCH] mm: bad_page optimisation
Nick Piggin [Fri, 6 Jan 2006 08:11:11 +0000 (00:11 -0800)]
Cut down size slightly by not passing bad_page the function name (it should be
able to be determined by dump_stack()). And cut down the number of printks in
bad_page.
Also, cut down some branching in the destroy_compound_page path.
--
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>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] mm/page_alloc.c: fix a typo
2008-05-06 9:50 ` Li Zefan
2008-05-06 14:19 ` Andrew Morton
@ 2008-05-06 17:51 ` Christoph Lameter
2008-05-08 0:08 ` KOSAKI Motohiro
1 sibling, 1 reply; 11+ messages in thread
From: Christoph Lameter @ 2008-05-06 17:51 UTC (permalink / raw)
To: Li Zefan; +Cc: Andrew Morton, LKML, linux-mm
On Tue, 6 May 2008, Li Zefan wrote:
> Sorry for the noise, but the signed-off was eaten. :(
> Maybe I should leave a blank line before the signed-off.
I think the | there was some developers attempt to avoid gcc generating
too many branches. I am fine either way.
--
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>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] mm/page_alloc.c: fix a typo
2008-05-06 17:51 ` Christoph Lameter
@ 2008-05-08 0:08 ` KOSAKI Motohiro
0 siblings, 0 replies; 11+ messages in thread
From: KOSAKI Motohiro @ 2008-05-08 0:08 UTC (permalink / raw)
To: Christoph Lameter
Cc: kosaki.motohiro, Li Zefan, Andrew Morton, LKML, linux-mm
> > Sorry for the noise, but the signed-off was eaten. :(
> > Maybe I should leave a blank line before the signed-off.
>
> I think the | there was some developers attempt to avoid gcc generating
> too many branches. I am fine either way.
Agreed.
but it is not normal conding style.
comment adding is better, IMHO.
at first, I think typo too.
--
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>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] mm/page_alloc.c: fix a typo
2008-05-06 9:38 [PATCH] mm/page_alloc.c: fix a typo Li Zefan
2008-05-06 9:41 ` Li Zefan
@ 2008-05-06 18:18 ` Oliver Pinter
2008-05-06 18:26 ` Christoph Lameter
1 sibling, 1 reply; 11+ messages in thread
From: Oliver Pinter @ 2008-05-06 18:18 UTC (permalink / raw)
To: Li Zefan; +Cc: Andrew Morton, clameter, LKML, linux-mm, stable, stable
On 5/6/08, Li Zefan <lizf@cn.fujitsu.com> wrote:
>
> ---
> mm/page_alloc.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index bdd5c43..d0ba10d 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -303,7 +303,7 @@ static void destroy_compound_page(struct page *page,
> unsigned long order)
> for (i = 1; i < nr_pages; i++) {
> struct page *p = page + i;
>
> - if (unlikely(!PageTail(p) |
> + if (unlikely(!PageTail(p) ||
> (p->first_page != page)))
> bad_page(page);
> __ClearPageTail(p);
> -- 1.5.4.rc3
> --
> 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/
>
--
Thanks,
Oliver
--
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>
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH] mm/page_alloc.c: fix a typo
2008-05-06 18:18 ` Oliver Pinter
@ 2008-05-06 18:26 ` Christoph Lameter
2008-05-06 18:28 ` Oliver Pinter
0 siblings, 1 reply; 11+ messages in thread
From: Christoph Lameter @ 2008-05-06 18:26 UTC (permalink / raw)
To: Oliver Pinter; +Cc: Li Zefan, Andrew Morton, LKML, linux-mm, stable
On Tue, 6 May 2008, Oliver Pinter wrote:
> CC: stable
Not a bug, nor a typo so why stable?
--
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>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] mm/page_alloc.c: fix a typo
2008-05-06 18:26 ` Christoph Lameter
@ 2008-05-06 18:28 ` Oliver Pinter
0 siblings, 0 replies; 11+ messages in thread
From: Oliver Pinter @ 2008-05-06 18:28 UTC (permalink / raw)
To: Christoph Lameter; +Cc: Li Zefan, Andrew Morton, LKML, linux-mm, stable
sorry,
when it is not bug
On 5/6/08, Christoph Lameter <clameter@sgi.com> wrote:
> On Tue, 6 May 2008, Oliver Pinter wrote:
>
> > CC: stable
>
> Not a bug, nor a typo so why stable?
>
>
--
Thanks,
Oliver
--
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>
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2008-05-08 0:08 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-06 9:38 [PATCH] mm/page_alloc.c: fix a typo Li Zefan
2008-05-06 9:41 ` Li Zefan
2008-05-06 9:50 ` Li Zefan
2008-05-06 14:19 ` Andrew Morton
2008-05-07 1:27 ` Li Zefan
2008-05-07 4:32 ` Li Zefan
2008-05-06 17:51 ` Christoph Lameter
2008-05-08 0:08 ` KOSAKI Motohiro
2008-05-06 18:18 ` Oliver Pinter
2008-05-06 18:26 ` Christoph Lameter
2008-05-06 18:28 ` Oliver Pinter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox