* [PATCH] fix do_xor_speed 64-bit devision issue on 32-bits arch @ 2011-12-07 14:08 Benny Halevy 2011-12-23 6:41 ` fanchaoting 0 siblings, 1 reply; 8+ messages in thread From: Benny Halevy @ 2011-12-07 14:08 UTC (permalink / raw) To: linux-nfs; +Cc: Benny Halevy I am trying to build a pnfs client on a 32 bit system and the pnfs-latest kernel fails to compile. I get the following error > Building modules, stage 2. > TEST posttest > MODPOST 2046 modules >ERROR: "__udivdi3" [crypto/xor.ko] undefined! >make[1]: *** [__modpost] Error 1 >make: *** [modules] Error 2 >make: *** Waiting for unfinished jobs.... >Succeed: decoded and checked 1244492 instructions Reported-by: Rita Sequeira <rita.prajval@gmail.com> Signed-off-by: Benny Halevy <bhalevy@tonian.com> --- untested patch yet... crypto/xor.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/crypto/xor.c b/crypto/xor.c index 65433f5..2151ded 100644 --- a/crypto/xor.c +++ b/crypto/xor.c @@ -95,7 +95,8 @@ ns_end -= ns_begin; if (ns_end > 0) - speed = BENCH_SIZE / 1024 * count * NSEC_PER_SEC / ns_end; + speed = BENCH_SIZE / 1024 * count * + (unsigned)(NSEC_PER_SEC / ns_end); else speed = 17; tmpl->speed = speed; -- 1.7.6 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] fix do_xor_speed 64-bit devision issue on 32-bits arch 2011-12-07 14:08 [PATCH] fix do_xor_speed 64-bit devision issue on 32-bits arch Benny Halevy @ 2011-12-23 6:41 ` fanchaoting 2011-12-23 13:25 ` Jim Rees 0 siblings, 1 reply; 8+ messages in thread From: fanchaoting @ 2011-12-23 6:41 UTC (permalink / raw) To: Benny Halevy; +Cc: linux-nfs Benny Halevy 写道: > I am trying to build a pnfs client on a 32 bit system and the > pnfs-latest kernel fails to compile. I get the following error > > > Building modules, stage 2. > > TEST posttest > > MODPOST 2046 modules > >ERROR: "__udivdi3" [crypto/xor.ko] undefined! > >make[1]: *** [__modpost] Error 1 > >make: *** [modules] Error 2 > >make: *** Waiting for unfinished jobs.... > >Succeed: decoded and checked 1244492 instructions > > Reported-by: Rita Sequeira <rita.prajval@gmail.com> > Signed-off-by: Benny Halevy <bhalevy@tonian.com> > --- > > untested patch yet... > > crypto/xor.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/crypto/xor.c b/crypto/xor.c > index 65433f5..2151ded 100644 > --- a/crypto/xor.c > +++ b/crypto/xor.c > @@ -95,7 +95,8 @@ > > ns_end -= ns_begin; > if (ns_end > 0) > - speed = BENCH_SIZE / 1024 * count * NSEC_PER_SEC / ns_end; > + speed = BENCH_SIZE / 1024 * count * > + (unsigned)(NSEC_PER_SEC / ns_end); > else > speed = 17; > tmpl->speed = speed; Hi,I also meet this problem ,but when i use you patch ,i can't solve this problem. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] fix do_xor_speed 64-bit devision issue on 32-bits arch 2011-12-23 6:41 ` fanchaoting @ 2011-12-23 13:25 ` Jim Rees 2011-12-25 5:31 ` Benny Halevy 0 siblings, 1 reply; 8+ messages in thread From: Jim Rees @ 2011-12-23 13:25 UTC (permalink / raw) To: fanchaoting; +Cc: Benny Halevy, linux-nfs fanchaoting wrote: Benny Halevy 写道: > I am trying to build a pnfs client on a 32 bit system and the > pnfs-latest kernel fails to compile. I get the following error > > > Building modules, stage 2. > > TEST posttest > > MODPOST 2046 modules > >ERROR: "__udivdi3" [crypto/xor.ko] undefined! > >make[1]: *** [__modpost] Error 1 > >make: *** [modules] Error 2 > >make: *** Waiting for unfinished jobs.... > >Succeed: decoded and checked 1244492 instructions > > Reported-by: Rita Sequeira <rita.prajval@gmail.com> > Signed-off-by: Benny Halevy <bhalevy@tonian.com> > --- > > untested patch yet... > > crypto/xor.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/crypto/xor.c b/crypto/xor.c > index 65433f5..2151ded 100644 > --- a/crypto/xor.c > +++ b/crypto/xor.c > @@ -95,7 +95,8 @@ > > ns_end -= ns_begin; > if (ns_end > 0) > - speed = BENCH_SIZE / 1024 * count * NSEC_PER_SEC / ns_end; > + speed = BENCH_SIZE / 1024 * count * > + (unsigned)(NSEC_PER_SEC / ns_end); > else > speed = 17; > tmpl->speed = speed; Hi,I also meet this problem ,but when i use you patch ,i can't solve this problem. Maybe something like this? speed = do_div(BENCH_SIZE, 1024) * count * do_div(NSEC_PER_SEC, ns_end); This might not be exactly right because it changes the operator precedence, but it should eliminate the calls to __udivdi3. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] fix do_xor_speed 64-bit devision issue on 32-bits arch 2011-12-23 13:25 ` Jim Rees @ 2011-12-25 5:31 ` Benny Halevy 2011-12-25 13:54 ` Jim Rees 2011-12-25 15:25 ` Boaz Harrosh 0 siblings, 2 replies; 8+ messages in thread From: Benny Halevy @ 2011-12-25 5:31 UTC (permalink / raw) To: Boaz Harrosh; +Cc: Jim Rees, fanchaoting, Benny Halevy, linux-nfs On 2011-12-23 15:25, Jim Rees wrote: > fanchaoting wrote: > > Benny Halevy 写道: > > I am trying to build a pnfs client on a 32 bit system and the > > pnfs-latest kernel fails to compile. I get the following error > > > > > Building modules, stage 2. > > > TEST posttest > > > MODPOST 2046 modules > > >ERROR: "__udivdi3" [crypto/xor.ko] undefined! > > >make[1]: *** [__modpost] Error 1 > > >make: *** [modules] Error 2 > > >make: *** Waiting for unfinished jobs.... > > >Succeed: decoded and checked 1244492 instructions > > > > Reported-by: Rita Sequeira <rita.prajval@gmail.com> > > Signed-off-by: Benny Halevy <bhalevy@tonian.com> > > --- > > > > untested patch yet... > > > > crypto/xor.c | 3 ++- > > 1 files changed, 2 insertions(+), 1 deletions(-) > > > > diff --git a/crypto/xor.c b/crypto/xor.c > > index 65433f5..2151ded 100644 > > --- a/crypto/xor.c > > +++ b/crypto/xor.c > > @@ -95,7 +95,8 @@ > > > > ns_end -= ns_begin; > > if (ns_end > 0) > > - speed = BENCH_SIZE / 1024 * count * NSEC_PER_SEC / ns_end; > > + speed = BENCH_SIZE / 1024 * count * > > + (unsigned)(NSEC_PER_SEC / ns_end); > > else > > speed = 17; > > tmpl->speed = speed; > > Hi,I also meet this problem ,but when i use you patch ,i can't solve this > problem. > > Maybe something like this? > > speed = do_div(BENCH_SIZE, 1024) * count * do_div(NSEC_PER_SEC, ns_end); > > This might not be exactly right because it changes the operator precedence, > but it should eliminate the calls to __udivdi3. Hmm, you mean execution order? (which you do not) C (and fortunately gcc too :) treats multiplication and division with the same priority and executes them from left to right... Boaz, please ack... Benny > -- > To unsubscribe from this list: send the line "unsubscribe linux-nfs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] fix do_xor_speed 64-bit devision issue on 32-bits arch 2011-12-25 5:31 ` Benny Halevy @ 2011-12-25 13:54 ` Jim Rees 2011-12-25 15:25 ` Boaz Harrosh 1 sibling, 0 replies; 8+ messages in thread From: Jim Rees @ 2011-12-25 13:54 UTC (permalink / raw) To: Benny Halevy; +Cc: Boaz Harrosh, fanchaoting, Benny Halevy, linux-nfs Benny Halevy wrote: > speed = do_div(BENCH_SIZE, 1024) * count * do_div(NSEC_PER_SEC, ns_end); > > This might not be exactly right because it changes the operator precedence, > but it should eliminate the calls to __udivdi3. Hmm, you mean execution order? (which you do not) C (and fortunately gcc too :) treats multiplication and division with the same priority and executes them from left to right... Yes, execution order. The original code executes left-to-right, my code executes the divisions first. But I wouldn't blindly apply this without understanding what's going on here. I thought the -fno-tree-scev-cprop compiler flag was supposed to emit division code instead of calling into a library. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] fix do_xor_speed 64-bit devision issue on 32-bits arch 2011-12-25 5:31 ` Benny Halevy 2011-12-25 13:54 ` Jim Rees @ 2011-12-25 15:25 ` Boaz Harrosh 2011-12-25 15:57 ` Jim Rees 2011-12-26 7:11 ` Benny Halevy 1 sibling, 2 replies; 8+ messages in thread From: Boaz Harrosh @ 2011-12-25 15:25 UTC (permalink / raw) To: Benny Halevy; +Cc: Jim Rees, fanchaoting, Benny Halevy, linux-nfs On 12/25/2011 07:31 AM, Benny Halevy wrote: > On 2011-12-23 15:25, Jim Rees wrote: >> fanchaoting wrote: >> >> Benny Halevy 写道: >> > I am trying to build a pnfs client on a 32 bit system and the >> > pnfs-latest kernel fails to compile. I get the following error >> > >> > > Building modules, stage 2. >> > > TEST posttest >> > > MODPOST 2046 modules >> > >ERROR: "__udivdi3" [crypto/xor.ko] undefined! >> > >make[1]: *** [__modpost] Error 1 >> > >make: *** [modules] Error 2 >> > >make: *** Waiting for unfinished jobs.... >> > >Succeed: decoded and checked 1244492 instructions >> > >> > Reported-by: Rita Sequeira <rita.prajval@gmail.com> >> > Signed-off-by: Benny Halevy <bhalevy@tonian.com> >> > --- >> > >> > untested patch yet... >> > >> > crypto/xor.c | 3 ++- >> > 1 files changed, 2 insertions(+), 1 deletions(-) >> > >> > diff --git a/crypto/xor.c b/crypto/xor.c >> > index 65433f5..2151ded 100644 >> > --- a/crypto/xor.c >> > +++ b/crypto/xor.c >> > @@ -95,7 +95,8 @@ >> > >> > ns_end -= ns_begin; >> > if (ns_end > 0) >> > - speed = BENCH_SIZE / 1024 * count * NSEC_PER_SEC / ns_end; >> > + speed = BENCH_SIZE / 1024 * count * >> > + (unsigned)(NSEC_PER_SEC / ns_end); >> > else >> > speed = 17; >> > tmpl->speed = speed; >> >> Hi,I also meet this problem ,but when i use you patch ,i can't solve this >> problem. >> >> Maybe something like this? >> >> speed = do_div(BENCH_SIZE, 1024) * count * do_div(NSEC_PER_SEC, ns_end); >> >> This might not be exactly right because it changes the operator precedence, >> but it should eliminate the calls to __udivdi3. > > Hmm, you mean execution order? (which you do not) > C (and fortunately gcc too :) treats multiplication and division with the > same priority and executes them from left to right... > > Boaz, please ack... > Hi Please trash this patch for now. I will carry it out of tree for my use. (Looks I'm the only one who's using UML and the XOR engine) By next Connectathon I'll have a better patch sent to the right people. Thanks for your efforts, and sorry for the grief it caused. Boaz > Benny > >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] fix do_xor_speed 64-bit devision issue on 32-bits arch 2011-12-25 15:25 ` Boaz Harrosh @ 2011-12-25 15:57 ` Jim Rees 2011-12-26 7:11 ` Benny Halevy 1 sibling, 0 replies; 8+ messages in thread From: Jim Rees @ 2011-12-25 15:57 UTC (permalink / raw) To: Boaz Harrosh; +Cc: Benny Halevy, fanchaoting, Benny Halevy, linux-nfs Boaz Harrosh wrote: Please trash this patch for now. I will carry it out of tree for my use. (Looks I'm the only one who's using UML and the XOR engine) UML would explain it. Regular kernels should be ok. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] fix do_xor_speed 64-bit devision issue on 32-bits arch 2011-12-25 15:25 ` Boaz Harrosh 2011-12-25 15:57 ` Jim Rees @ 2011-12-26 7:11 ` Benny Halevy 1 sibling, 0 replies; 8+ messages in thread From: Benny Halevy @ 2011-12-26 7:11 UTC (permalink / raw) To: Boaz Harrosh; +Cc: Jim Rees, fanchaoting, linux-nfs No problem. I'll revert it then. Thanks, Benny On Sun, Dec 25, 2011 at 5:25 PM, Boaz Harrosh <bharrosh@panasas.com> wrote: > On 12/25/2011 07:31 AM, Benny Halevy wrote: >> On 2011-12-23 15:25, Jim Rees wrote: >>> fanchaoting wrote: >>> >>> Benny Halevy 写道: >>> > I am trying to build a pnfs client on a 32 bit system and the >>> > pnfs-latest kernel fails to compile. I get the following error >>> > >>> > > Building modules, stage 2. >>> > > TEST posttest >>> > > MODPOST 2046 modules >>> > >ERROR: "__udivdi3" [crypto/xor.ko] undefined! >>> > >make[1]: *** [__modpost] Error 1 >>> > >make: *** [modules] Error 2 >>> > >make: *** Waiting for unfinished jobs.... >>> > >Succeed: decoded and checked 1244492 instructions >>> > >>> > Reported-by: Rita Sequeira <rita.prajval@gmail.com> >>> > Signed-off-by: Benny Halevy <bhalevy@tonian.com> >>> > --- >>> > >>> > untested patch yet... >>> > >>> > crypto/xor.c | 3 ++- >>> > 1 files changed, 2 insertions(+), 1 deletions(-) >>> > >>> > diff --git a/crypto/xor.c b/crypto/xor.c >>> > index 65433f5..2151ded 100644 >>> > --- a/crypto/xor.c >>> > +++ b/crypto/xor.c >>> > @@ -95,7 +95,8 @@ >>> > >>> > ns_end -= ns_begin; >>> > if (ns_end > 0) >>> > - speed = BENCH_SIZE / 1024 * count * NSEC_PER_SEC / ns_end; >>> > + speed = BENCH_SIZE / 1024 * count * >>> > + (unsigned)(NSEC_PER_SEC / ns_end); >>> > else >>> > speed = 17; >>> > tmpl->speed = speed; >>> >>> Hi,I also meet this problem ,but when i use you patch ,i can't solve this >>> problem. >>> >>> Maybe something like this? >>> >>> speed = do_div(BENCH_SIZE, 1024) * count * do_div(NSEC_PER_SEC, ns_end); >>> >>> This might not be exactly right because it changes the operator precedence, >>> but it should eliminate the calls to __udivdi3. >> >> Hmm, you mean execution order? (which you do not) >> C (and fortunately gcc too :) treats multiplication and division with the >> same priority and executes them from left to right... >> >> Boaz, please ack... >> > > Hi > > Please trash this patch for now. I will carry it out of tree for my use. > (Looks I'm the only one who's using UML and the XOR engine) > > By next Connectathon I'll have a better patch sent to the right > people. > > Thanks for your efforts, and sorry for the grief it caused. > Boaz > >> Benny >> >>> -- >>> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in >>> the body of a message to majordomo@vger.kernel.org >>> More majordomo info at http://vger.kernel.org/majordomo-info.html > ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-12-26 7:11 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-12-07 14:08 [PATCH] fix do_xor_speed 64-bit devision issue on 32-bits arch Benny Halevy 2011-12-23 6:41 ` fanchaoting 2011-12-23 13:25 ` Jim Rees 2011-12-25 5:31 ` Benny Halevy 2011-12-25 13:54 ` Jim Rees 2011-12-25 15:25 ` Boaz Harrosh 2011-12-25 15:57 ` Jim Rees 2011-12-26 7:11 ` Benny Halevy
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).