Re: [PATCH] lib/zstd: use div_u64() to let it build on 32-bit

2017-06-28 Thread Adam Borowski
On Tue, Jun 27, 2017 at 05:27:51AM +, Nick Terrell wrote: > Adam, I’ve applied the same patch in my tree. I’ll send out the update [1] > once it's reviewed, since I also reduced the stack usage of functions > using over 1 KB of stack space. > > I have userland tests set up mocking the linux

Re: [PATCH] lib/zstd: use div_u64() to let it build on 32-bit

2017-06-28 Thread Adam Borowski
On Tue, Jun 27, 2017 at 05:27:51AM +, Nick Terrell wrote: > Adam, I’ve applied the same patch in my tree. I’ll send out the update [1] > once it's reviewed, since I also reduced the stack usage of functions > using over 1 KB of stack space. > > I have userland tests set up mocking the linux

Re: [PATCH] lib/zstd: use div_u64() to let it build on 32-bit

2017-06-27 Thread Nick Terrell
> Please don't top post. Sorry about that. > Which function needs 1KB of stack space? That's quite a lot. FSE_buildCTable_wksp(), FSE_compress_wksp(), and HUF_readDTableX4() required over 1 KB of stack space. > I can see in [1] that there are some on-stack buffers replaced by > pointers to the

Re: [PATCH] lib/zstd: use div_u64() to let it build on 32-bit

2017-06-27 Thread Nick Terrell
> Please don't top post. Sorry about that. > Which function needs 1KB of stack space? That's quite a lot. FSE_buildCTable_wksp(), FSE_compress_wksp(), and HUF_readDTableX4() required over 1 KB of stack space. > I can see in [1] that there are some on-stack buffers replaced by > pointers to the

Re: [PATCH] lib/zstd: use div_u64() to let it build on 32-bit

2017-06-27 Thread David Sterba
Please don't top post. On Tue, Jun 27, 2017 at 05:27:51AM +, Nick Terrell wrote: > Adam, I’ve applied the same patch in my tree. I’ll send out the update [1] > once it's reviewed, since I also reduced the stack usage of functions > using over 1 KB of stack space. Which function needs 1KB of

Re: [PATCH] lib/zstd: use div_u64() to let it build on 32-bit

2017-06-27 Thread David Sterba
Please don't top post. On Tue, Jun 27, 2017 at 05:27:51AM +, Nick Terrell wrote: > Adam, I’ve applied the same patch in my tree. I’ll send out the update [1] > once it's reviewed, since I also reduced the stack usage of functions > using over 1 KB of stack space. Which function needs 1KB of

Re: [PATCH] lib/zstd: use div_u64() to let it build on 32-bit

2017-06-26 Thread Nick Terrell
Adam, I’ve applied the same patch in my tree. I’ll send out the update [1] once it's reviewed, since I also reduced the stack usage of functions using over 1 KB of stack space. You’re right that div_u64() will work, since the FSE functions are only called on blocks of at most 128 KB at a time.

Re: [PATCH] lib/zstd: use div_u64() to let it build on 32-bit

2017-06-26 Thread Nick Terrell
Adam, I’ve applied the same patch in my tree. I’ll send out the update [1] once it's reviewed, since I also reduced the stack usage of functions using over 1 KB of stack space. You’re right that div_u64() will work, since the FSE functions are only called on blocks of at most 128 KB at a time.

[PATCH] lib/zstd: use div_u64() to let it build on 32-bit

2017-06-26 Thread Adam Borowski
David Sterba wrote: > > Thus, you want do_div() instead of /; do check widths and signedness of > > arguments. > > No do_div please, div_u64 or div64_u64. Good to know, the interface of do_div() is indeed weird. I guess Nick has found and fixed the offending divisions in his tree already, but

[PATCH] lib/zstd: use div_u64() to let it build on 32-bit

2017-06-26 Thread Adam Borowski
David Sterba wrote: > > Thus, you want do_div() instead of /; do check widths and signedness of > > arguments. > > No do_div please, div_u64 or div64_u64. Good to know, the interface of do_div() is indeed weird. I guess Nick has found and fixed the offending divisions in his tree already, but