[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <532385.1692184743@warthog.procyon.org.uk>
Date: Wed, 16 Aug 2023 12:19:03 +0100
From: David Howells <dhowells@...hat.com>
To: David Laight <David.Laight@...LAB.COM>
Cc: dhowells@...hat.com,
Linus Torvalds <torvalds@...ux-foundation.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
Jens Axboe <axboe@...nel.dk>, Christoph Hellwig <hch@....de>,
Christian Brauner <christian@...uner.io>,
Matthew Wilcox <willy@...radead.org>,
"jlayton@...nel.org" <jlayton@...nel.org>,
"linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH v2] iov_iter: Convert iterate*() to inline funcs
David Laight <David.Laight@...LAB.COM> wrote:
> > That can't be avoided if I convert everything to inline functions and
> > function pointers - but the optimiser can get rid of it where it can
> > inline the step function.
>
> AFAICT the IOVEC one was only called directly.
I've made some changes that I'll post shortly, and I now get this:
...
<+36>: cmpb $0x0,0x1(%rdx) # iter->copy_mc
...
<+46>: je 0xffffffff81779aae <_copy_from_iter+98>
<+48>: jmp 0xffffffff81779a87 <_copy_from_iter+59>
...
# Handle ->copy_mc == true
<+59>: mov 0x38(%rsp),%rax
<+64>: sub %gs:0x28,%rax
<+73>: jne 0xffffffff81779db1 <_copy_from_iter+869>
<+79>: add $0x40,%rsp
<+83>: pop %rbx
<+84>: pop %rbp
<+85>: pop %r12
<+87>: pop %r13
<+89>: pop %r14
<+91>: pop %r15
<+93>: jmp 0xffffffff81777934 <__copy_from_iter_mc>
...
# ITER_UBUF
<+121>: mov (%rdx),%al
<+123>: cmp $0x5,%al
<+125>: jne 0xffffffff81779b01 <_copy_from_iter+181>
...
<+147>: call 0xffffffff817777ee <__access_ok>
<+152>: test %al,%al
<+154>: je 0xffffffff81779af9 <_copy_from_iter+173>
<+156>: nop
<+157>: nop
<+158>: nop
<+159>: mov %r12,%rdi
<+162>: mov %rdx,%rsi
<+165>: rep movsb %ds:(%rsi),%es:(%rdi)
...
# ITER_IOVEC
<+181>: test %al,%al
<+183>: jne 0xffffffff81779b8d <_copy_from_iter+321>
...
<+234>: call 0xffffffff817777ee <__access_ok>
<+239>: test %al,%al
<+241>: je 0xffffffff81779b54 <_copy_from_iter+264>
<+243>: nop
<+244>: nop
<+245>: nop
<+246>: lea (%r12,%r15,1),%rax
<+250>: mov %r8,%rsi
<+253>: mov %rax,%rdi
<+256>: rep movsb %ds:(%rsi),%es:(%rdi)
...
# ITER_BVEC
<+321>: cmp $0x2,%al
<+323>: jne 0xffffffff81779c1f <_copy_from_iter+467>
...
<+375>: call 0xffffffff81777282 <kmap_local_page>
...
<+431>: rep movsb %ds:(%rsi),%es:(%rdi)
...
# ITER_KVEC
<+467>: cmp $0x1,%al
<+469>: jne 0xffffffff81779c82 <_copy_from_iter+566>
...
<+526>: rep movsb %ds:(%rsi),%es:(%rdi)
...
# ITER_XARRAY
<+566>: cmp $0x3,%al
<+568>: jne 0xffffffff81779d9d <_copy_from_iter+849>
...
<+639>: call 0xffffffff81126bcf <__rcu_read_lock>
...
<+651>: call 0xffffffff81d5ed97 <xas_find>
...
<+764>: call 0xffffffff817772a7 <kmap_local_folio>
...
<+806>: rep movsb %ds:(%rsi),%es:(%rdi)
...
# ITER_DISCARD/default
<+849>: sub %rbx,0x18(%rbp)
<+853>: mov 0x38(%rsp),%rax
<+858>: sub %gs:0x28,%rax
<+867>: je 0xffffffff81779db6 <_copy_from_iter+874>
<+869>: call 0xffffffff81d6578c <__stack_chk_fail>
<+874>: add $0x40,%rsp
<+878>: mov %rbx,%rax
<+881>: pop %rbx
<+882>: pop %rbp
<+883>: pop %r12
<+885>: pop %r13
<+887>: pop %r14
<+889>: pop %r15
<+891>: jmp 0xffffffff81d72920 <__x86_return_thunk>
David
Powered by blists - more mailing lists