Re: [PATCH] iov_iter: optimise iter type checking

2021-01-28 Thread Pavel Begunkov
On 27/01/2021 18:31, Al Viro wrote: > On Wed, Jan 27, 2021 at 03:48:10PM +, Pavel Begunkov wrote: >> On 16/01/2021 05:18, Al Viro wrote: >>> On Sat, Jan 09, 2021 at 10:11:09PM +, Pavel Begunkov wrote: >>> > Does any code actually look at the fields as a pair? > Would it even be bett

Re: [PATCH] iov_iter: optimise iter type checking

2021-01-27 Thread Al Viro
On Wed, Jan 27, 2021 at 03:48:10PM +, Pavel Begunkov wrote: > On 16/01/2021 05:18, Al Viro wrote: > > On Sat, Jan 09, 2021 at 10:11:09PM +, Pavel Begunkov wrote: > > > >>> Does any code actually look at the fields as a pair? > >>> Would it even be better to use separate bytes? > >>> Even g

Re: [PATCH] iov_iter: optimise iter type checking

2021-01-27 Thread Al Viro
On Wed, Jan 27, 2021 at 04:28:38PM +, David Laight wrote: > I'd definitely leave the type as a bitmap. What the hell for? Microoptimizations in places where we have much heavier stuff to be done are bloody pointless. It's already overcomplicated. And compiler is _not_ going to be able to p

RE: [PATCH] iov_iter: optimise iter type checking

2021-01-27 Thread David Laight
From: Pavel Begunkov > Sent: 27 January 2021 15:48 > > On 16/01/2021 05:18, Al Viro wrote: > > On Sat, Jan 09, 2021 at 10:11:09PM +, Pavel Begunkov wrote: > > > >>> Does any code actually look at the fields as a pair? > >>> Would it even be better to use separate bytes? > >>> Even growing the

Re: [PATCH] iov_iter: optimise iter type checking

2021-01-27 Thread Pavel Begunkov
On 16/01/2021 05:18, Al Viro wrote: > On Sat, Jan 09, 2021 at 10:11:09PM +, Pavel Begunkov wrote: > >>> Does any code actually look at the fields as a pair? >>> Would it even be better to use separate bytes? >>> Even growing the on-stack structure by a word won't really matter. >> >> u8 type,

RE: [PATCH] iov_iter: optimise iter type checking

2021-01-17 Thread David Laight
From: Al Viro > Sent: 16 January 2021 05:18 > > On Sat, Jan 09, 2021 at 10:11:09PM +, Pavel Begunkov wrote: > > > > Does any code actually look at the fields as a pair? > > > Would it even be better to use separate bytes? > > > Even growing the on-stack structure by a word won't really matter

Re: [PATCH] iov_iter: optimise iter type checking

2021-01-15 Thread Al Viro
On Sat, Jan 09, 2021 at 10:11:09PM +, Pavel Begunkov wrote: > > Does any code actually look at the fields as a pair? > > Would it even be better to use separate bytes? > > Even growing the on-stack structure by a word won't really matter. > > u8 type, rw; > > That won't bloat the struct. I l

Re: [PATCH] iov_iter: optimise iter type checking

2021-01-12 Thread Pavel Begunkov
On 11/01/2021 09:35, David Laight wrote: > From: Pavel Begunkov >> Sent: 09 January 2021 22:11 > >>> Does any code actually look at the fields as a pair? >>> Would it even be better to use separate bytes? >>> Even growing the on-stack structure by a word won't really matter. >> >> u8 type, rw;

RE: [PATCH] iov_iter: optimise iter type checking

2021-01-11 Thread David Laight
From: Pavel Begunkov > Sent: 09 January 2021 22:11 > > Does any code actually look at the fields as a pair? > > Would it even be better to use separate bytes? > > Even growing the on-stack structure by a word won't really matter. > > u8 type, rw; > > That won't bloat the struct. I like the i

Re: [PATCH] iov_iter: optimise iter type checking

2021-01-09 Thread Pavel Begunkov
On 09/01/2021 21:49, David Laight wrote: > From: Al Viro >> Sent: 09 January 2021 17:04 >> >> On Sat, Jan 09, 2021 at 04:09:08PM +, Pavel Begunkov wrote: >>> On 06/12/2020 16:01, Pavel Begunkov wrote: On 21/11/2020 14:37, Pavel Begunkov wrote: > The problem here is that iov_iter_is_*()

RE: [PATCH] iov_iter: optimise iter type checking

2021-01-09 Thread David Laight
From: Al Viro > Sent: 09 January 2021 17:04 > > On Sat, Jan 09, 2021 at 04:09:08PM +, Pavel Begunkov wrote: > > On 06/12/2020 16:01, Pavel Begunkov wrote: > > > On 21/11/2020 14:37, Pavel Begunkov wrote: > > >> The problem here is that iov_iter_is_*() helpers check types for > > >> equality, b

Re: [PATCH] iov_iter: optimise iter type checking

2021-01-09 Thread Pavel Begunkov
On 09/01/2021 17:03, Al Viro wrote: > On Sat, Jan 09, 2021 at 04:09:08PM +, Pavel Begunkov wrote: >> On 06/12/2020 16:01, Pavel Begunkov wrote: >>> On 21/11/2020 14:37, Pavel Begunkov wrote: The problem here is that iov_iter_is_*() helpers check types for equality, but all iterate_* h

Re: [PATCH] iov_iter: optimise iter type checking

2021-01-09 Thread Al Viro
On Sat, Jan 09, 2021 at 04:09:08PM +, Pavel Begunkov wrote: > On 06/12/2020 16:01, Pavel Begunkov wrote: > > On 21/11/2020 14:37, Pavel Begunkov wrote: > >> The problem here is that iov_iter_is_*() helpers check types for > >> equality, but all iterate_* helpers do bitwise ands. This confuses >

Re: [PATCH] iov_iter: optimise iter type checking

2021-01-09 Thread Pavel Begunkov
On 06/12/2020 16:01, Pavel Begunkov wrote: > On 21/11/2020 14:37, Pavel Begunkov wrote: >> The problem here is that iov_iter_is_*() helpers check types for >> equality, but all iterate_* helpers do bitwise ands. This confuses >> compilers, so even if some cases were handled separately with >> iov_i

Re: [PATCH] iov_iter: optimise iter type checking

2020-12-06 Thread Pavel Begunkov
On 21/11/2020 14:37, Pavel Begunkov wrote: > The problem here is that iov_iter_is_*() helpers check types for > equality, but all iterate_* helpers do bitwise ands. This confuses > compilers, so even if some cases were handled separately with > iov_iter_is_*(), corresponding ifs in iterate*() right

[PATCH] iov_iter: optimise iter type checking

2020-11-21 Thread Pavel Begunkov
The problem here is that iov_iter_is_*() helpers check types for equality, but all iterate_* helpers do bitwise ands. This confuses compilers, so even if some cases were handled separately with iov_iter_is_*(), corresponding ifs in iterate*() right after are not eliminated. E.g. iov_iter_npages()