Re: Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-06-25 Thread Thomas Gleixner
On Tue, 25 Jun 2013, Darren Hart wrote: > Otherwise this looks ready to me. Thomas, do you want a resend with > commit message corrections or do you prefer to integrate those > yourself? > > With the above fixes: > > Acked-by: Darren Hart I pick it up and fix it. We delayed it long enough alre

Re: Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-06-25 Thread Darren Hart
Hi Zhang Yi, Thanks for turning around an update so quickly. The code itself looks ready to me. We try to maintain a high level of quality in the commit message as well to help with understanding complex systems such as futexes. On Tue, 2013-06-25 at 21:19 +0800, Zhang Yi wrote: > The futex-keys

RE: Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-06-25 Thread Zhang Yi
The futex-keys of processes share futex determined by page-offset, mapping-host, and mapping-index of the user space address. User appications using hugepage for futex may lead to futex-key conflict. Assume there are two or more futexes in diffrent normal pages of the hugepage, and each futex has

Re: Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-06-24 Thread Darren Hart
On Thu, 2013-05-16 at 10:00 +0800, zhang.y...@zte.com.cn wrote: > > Darren Hart wrote on 2013/05/16 09:30:31: > > > > > pgoff_t is an unsigned long, and page_to_pfn() returns an unsigned long. > > Since compound_idx can be assigned from page_to_pfn() and it is added > > with index in the return

Re: Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-05-15 Thread zhang . yi20
Darren Hart wrote on 2013/05/16 09:30:31: > > pgoff_t is an unsigned long, and page_to_pfn() returns an unsigned long. > Since compound_idx can be assigned from page_to_pfn() and it is added > with index in the return value, unsigned long seems like a better choice > to me. Is there a specific

Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-05-15 Thread Darren Hart
On 05/15/2013 06:16 PM, zhang.y...@zte.com.cn wrote: > > > Mel Gorman wrote on 2013/05/15 22:20:35: > > >> Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage >> >> On Wed, May 15, 2013 at 09:57:03PM +0800, Zhang Yi wrote: >>&g

Re: Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-05-15 Thread zhang . yi20
Mel Gorman wrote on 2013/05/15 22:20:35: > Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage > > On Wed, May 15, 2013 at 09:57:03PM +0800, Zhang Yi wrote: > > The futex-keys of processes share futex determined by page-offset, > > mapping-host, and

Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-05-15 Thread Mel Gorman
On Wed, May 15, 2013 at 09:57:03PM +0800, Zhang Yi wrote: > The futex-keys of processes share futex determined by page-offset, > mapping-host, and mapping-index of the user space address. User > appications using hugepage for futex may lead to futex-key conflict. > > Assume there are two or more f

Re: Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-05-10 Thread Mel Gorman
On Fri, May 10, 2013 at 05:08:30PM +0800, zhang.y...@zte.com.cn wrote: > > > Mel Gorman wrote on 2013/05/07 23:20:07: > > > > > Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage > > > > On Tue, May 07, 2013 at 08:23:48PM +0800, Zhang

Re: Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-05-10 Thread zhang . yi20
Mel Gorman wrote on 2013/05/07 23:20:07: > > Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage > > On Tue, May 07, 2013 at 08:23:48PM +0800, Zhang Yi wrote: > > diff -uprN linux3.9-orig/kernel/futex.c linux3.9/kernel/futex.c > > --- linux3.9-orig/

Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-05-07 Thread Mel Gorman
On Tue, May 07, 2013 at 05:24:57PM +0200, Thomas Gleixner wrote: > > > On Tue, 7 May 2013, Mel Gorman wrote: > > > On Tue, May 07, 2013 at 08:23:48PM +0800, Zhang Yi wrote: > > > diff -uprN linux3.9-orig/kernel/futex.c linux3.9/kernel/futex.c > > > --- linux3.9-orig/kernel/futex.c 2013-04-15 00

Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-05-07 Thread Thomas Gleixner
On Tue, 7 May 2013, Mel Gorman wrote: > On Tue, May 07, 2013 at 08:23:48PM +0800, Zhang Yi wrote: > > diff -uprN linux3.9-orig/kernel/futex.c linux3.9/kernel/futex.c > > --- linux3.9-orig/kernel/futex.c2013-04-15 00:45:16.0 + > > +++ linux3.9/kernel/futex.c 2013-05-06 16:24:40.40

Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-05-07 Thread Mel Gorman
On Tue, May 07, 2013 at 08:23:48PM +0800, Zhang Yi wrote: > diff -uprN linux3.9-orig/kernel/futex.c linux3.9/kernel/futex.c > --- linux3.9-orig/kernel/futex.c 2013-04-15 00:45:16.0 + > +++ linux3.9/kernel/futex.c 2013-05-06 16:24:40.403525000 + > @@ -215,6 +215,22 @@ static v

RE: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-05-07 Thread Zhang Yi
Hi, The futex-keys of processes share futex determined by page-offset, mapping-host, and mapping-index of the user space address. User appications using hugepage for futex may lead to futex-key conflict. Assume there are two or more futexes in diffrent normal pages of the hugepage, and each futex

RE: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-05-07 Thread Zhang Yi
ner' > Cc: 'linux-kernel@vger.kernel.org'; 'Peter Zijlstra'; 'Darren Hart'; 'Ingo > Molnar'; 'Dave Hansen'; 'zhang.y...@zte.com.cn'; > 'wet...@163.com' > Subject: RE: [PATCH] futex: bugfix for futex-key

RE: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-05-07 Thread Zhang Yi
27;; zhang.y...@zte.com.cn; > wet...@163.com > Subject: Re: [PATCH] futex: bugfix for futex-key conflict when futex use > hugepage > > Zhang, > > On Fri, 26 Apr 2013, Zhang Yi wrote: > > At 2013-04-26 04:52:31,"Thomas Gleixner" wrote: > > > > > >Un

Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-04-26 Thread Thomas Gleixner
Zhang, On Fri, 26 Apr 2013, Zhang Yi wrote: > At 2013-04-26 04:52:31,"Thomas Gleixner" wrote: > > > >Unfortunately this did not work out very well. > > > >1. Your patch now lacks a proper changelog which explains the change > > > >2. Your patch lacks any newline characters as you can see below >

Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-04-25 Thread Thomas Gleixner
On Wed, 24 Apr 2013, Zhang Yi wrote: > Hi all, > > I reworked the patch base on your advices。 > For the line-wrapped bug before, I use this mailbox to send the mail . Unfortunately this did not work out very well. 1. Your patch now lacks a proper changelog which explains the change 2. Your pat

Re: Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-04-19 Thread zhang . yi20
Darren Hart wrote on 2013/04/19 10:45:00: > > > > BTW, have you seen the testcase in my other mail? It seems to be > > rejected by LKML. > > > > I did not receive it, did you also CC me? > > -- > Darren Hart > Intel Open Source Technology Center > Yocto Project - Technical Lead - Linux Ker

Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-04-18 Thread Darren Hart
> > BTW, have you seen the testcase in my other mail? It seems to be rejected > by LKML. > I did not receive it, did you also CC me? -- Darren Hart Intel Open Source Technology Center Yocto Project - Technical Lead - Linux Kernel -- To unsubscribe from this list: send the line "unsubscribe l

Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-04-18 Thread Darren Hart
On 04/18/2013 07:13 PM, zhang.y...@zte.com.cn wrote: > Darren Hart wrote on 2013/04/18 22:34:29: > >> On 04/18/2013 01:05 AM, zhang.y...@zte.com.cn wrote: >>> >>> I have run futextest/performance/futex_wait for testing, >>> 5 times before make it long: >>> futex_wait: Measure FUTEX_WAIT operati

Re: Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-04-18 Thread zhang . yi20
Darren Hart wrote on 2013/04/18 22:34:29: > On 04/18/2013 01:05 AM, zhang.y...@zte.com.cn wrote: > > > > I have run futextest/performance/futex_wait for testing, > > 5 times before make it long: > > futex_wait: Measure FUTEX_WAIT operations per second > > Arguments: iterations=1000

Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-04-18 Thread Darren Hart
On 04/18/2013 01:05 AM, zhang.y...@zte.com.cn wrote: > Darren Hart wrote on 2013/04/17 23:51:36: > >> On 04/17/2013 08:26 AM, Dave Hansen wrote: >>> On 04/17/2013 07:18 AM, Darren Hart wrote: >> This also needs a comment in futex.h describing the usage of the >> offset field in union fu

Re: Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-04-18 Thread zhang . yi20
Darren Hart wrote on 2013/04/17 23:51:36: > On 04/17/2013 08:26 AM, Dave Hansen wrote: > > On 04/17/2013 07:18 AM, Darren Hart wrote: > This also needs a comment in futex.h describing the usage of the > offset field in union futex_key as well as above get_futex_key > describing the

Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-04-17 Thread Darren Hart
On 04/17/2013 08:26 AM, Dave Hansen wrote: > On 04/17/2013 07:18 AM, Darren Hart wrote: This also needs a comment in futex.h describing the usage of the offset field in union futex_key as well as above get_futex_key describing the key for shared mappings. >>> As far as I know

Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-04-17 Thread Dave Hansen
On 04/17/2013 07:18 AM, Darren Hart wrote: >>> This also needs a comment in futex.h describing the usage of the offset >>> field in union futex_key as well as above get_futex_key describing the >>> key for shared mappings. >>> >> As far as I know , the max size of one hugepage is 1 GBytes for x86 c

Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-04-17 Thread Darren Hart
On 04/17/2013 02:55 AM, zhang.y...@zte.com.cn wrote: > Darren Hart wrote on 2013/04/17 01:57:10: > >> Again, a functional testcase in futextest would be a good idea. This >> helps validate the patch and also can be used to identify regressions in >> the future. > > I will post the testcase cod

Re: Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-04-17 Thread zhang . yi20
Darren Hart wrote on 2013/04/17 01:57:10: > Again, a functional testcase in futextest would be a good idea. This > helps validate the patch and also can be used to identify regressions in > the future. I will post the testcase code later. > > What is the max value of comp_idx? Are we at risk o

Re: Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-04-17 Thread zhang . yi20
Dave Hansen wrote on 2013/04/17 02:37:40: > Instead of bothering to store the index, why not just calculate it, like: > > On 04/15/2013 08:37 PM, zhang.y...@zte.com.cn wrote: > > +static inline int get_page_compound_index(struct page *page) > > +{ > > + if (PageHead(page)) > > +

Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-04-16 Thread Darren Hart
On 04/16/2013 11:37 AM, Dave Hansen wrote: > Instead of bothering to store the index, why not just calculate it, like: > > On 04/15/2013 08:37 PM, zhang.y...@zte.com.cn wrote: >> +static inline int get_page_compound_index(struct page *page) >> +{ >> + if (PageHead(page)) >> +

Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-04-16 Thread Dave Hansen
Instead of bothering to store the index, why not just calculate it, like: On 04/15/2013 08:37 PM, zhang.y...@zte.com.cn wrote: > +static inline int get_page_compound_index(struct page *page) > +{ > + if (PageHead(page)) > + return 0; > + return compound_head(page) - page;

Re: [PATCH] futex: bugfix for futex-key conflict when futex use hugepage

2013-04-16 Thread Darren Hart
On 04/15/2013 08:37 PM, zhang.y...@zte.com.cn wrote: > Hello, > Hi Zhang, I've rewrapped your plain text here for legibility, please adjust your mail client accordingly. > The futex-keys of processes share futex determined by page-offset, > mapping-host, and mapping-index of the user space addre