mbox series

[0/2] userfaultfd: handle few NULL check inline

Message ID 20241209132549.2878604-1-ruanjinjie@huawei.com (mailing list archive)
Headers show
Series userfaultfd: handle few NULL check inline | expand

Message

Jinjie Ruan Dec. 9, 2024, 1:25 p.m. UTC
Handle dup_userfaultfd() and anon_vma_fork() NULL check inline to
save some function call overhead. The Unixbench single core process
create has 1% improve with these patches.

Jinjie Ruan (2):
  userfaultfd: handle dup_userfaultfd() NULL check inline
  mm, rmap: handle anon_vma_fork() NULL check inline

 fs/userfaultfd.c              |  5 +----
 include/linux/rmap.h          | 12 +++++++++++-
 include/linux/userfaultfd_k.h | 11 ++++++++++-
 mm/rmap.c                     |  6 +-----
 4 files changed, 23 insertions(+), 11 deletions(-)

Comments

Lorenzo Stoakes Dec. 9, 2024, 1:42 p.m. UTC | #1
On Mon, Dec 09, 2024 at 09:25:47PM +0800, Jinjie Ruan wrote:
> Handle dup_userfaultfd() and anon_vma_fork() NULL check inline to
> save some function call overhead. The Unixbench single core process
> create has 1% improve with these patches.
>
> Jinjie Ruan (2):
>   userfaultfd: handle dup_userfaultfd() NULL check inline
>   mm, rmap: handle anon_vma_fork() NULL check inline
>
>  fs/userfaultfd.c              |  5 +----
>  include/linux/rmap.h          | 12 +++++++++++-
>  include/linux/userfaultfd_k.h | 11 ++++++++++-
>  mm/rmap.c                     |  6 +-----
>  4 files changed, 23 insertions(+), 11 deletions(-)
>
> --
> 2.34.1
>

Coincidentally I've just diagosed a rather nasty bug in this code [0], so
could we hold off on this change for just a little bit until we can get a
fix out for this please?

I'd rather not complicate anything until we're sure we won't need to change
this.

Thanks!


[0]:https://lore.kernel.org/linux-mm/aa2c1930-becc-4bc5-adfb-96e88290acc7@lucifer.local/
Jinjie Ruan Dec. 10, 2024, 1:21 a.m. UTC | #2
On 2024/12/9 21:42, Lorenzo Stoakes wrote:
> On Mon, Dec 09, 2024 at 09:25:47PM +0800, Jinjie Ruan wrote:
>> Handle dup_userfaultfd() and anon_vma_fork() NULL check inline to
>> save some function call overhead. The Unixbench single core process
>> create has 1% improve with these patches.
>>
>> Jinjie Ruan (2):
>>   userfaultfd: handle dup_userfaultfd() NULL check inline
>>   mm, rmap: handle anon_vma_fork() NULL check inline
>>
>>  fs/userfaultfd.c              |  5 +----
>>  include/linux/rmap.h          | 12 +++++++++++-
>>  include/linux/userfaultfd_k.h | 11 ++++++++++-
>>  mm/rmap.c                     |  6 +-----
>>  4 files changed, 23 insertions(+), 11 deletions(-)
>>
>> --
>> 2.34.1
>>
> 
> Coincidentally I've just diagosed a rather nasty bug in this code [0], so
> could we hold off on this change for just a little bit until we can get a
> fix out for this please?
> 
> I'd rather not complicate anything until we're sure we won't need to change
> this.

Sure, fix the bugs is a more urgent problem.

Thanks!

> 
> Thanks!
> 
> 
> [0]:https://lore.kernel.org/linux-mm/aa2c1930-becc-4bc5-adfb-96e88290acc7@lucifer.local/
>