Re: [PATCH] mm/mmu_notifier.c: micro-optimization substitute kzalloc with kmalloc

2020-09-08 Thread Jason Gunthorpe
On Tue, Sep 08, 2020 at 09:42:45AM +0300, Mike Rapoport wrote: > On Sun, Sep 06, 2020 at 06:06:39PM +0200, Mateusz Nosek wrote: > > Hi, > > > > I performed simple benchmarks using custom kernel module with the code > > fragment in question 'copy-pasted' in there in both versions. In case of 1k, >

Re: [PATCH] mm/mmu_notifier.c: micro-optimization substitute kzalloc with kmalloc

2020-09-08 Thread Mike Rapoport
On Sun, Sep 06, 2020 at 06:06:39PM +0200, Mateusz Nosek wrote: > Hi, > > I performed simple benchmarks using custom kernel module with the code > fragment in question 'copy-pasted' in there in both versions. In case of 1k, > 10k and 100k iterations the average time for kzalloc version was 5.1 and

Re: [PATCH] mm/mmu_notifier.c: micro-optimization substitute kzalloc with kmalloc

2020-09-06 Thread Mateusz Nosek
Hi, I performed simple benchmarks using custom kernel module with the code fragment in question 'copy-pasted' in there in both versions. In case of 1k, 10k and 100k iterations the average time for kzalloc version was 5.1 and for kmalloc 3.9, for each iterations number. The time was measured

Re: [PATCH] mm/mmu_notifier.c: micro-optimization substitute kzalloc with kmalloc

2020-09-06 Thread Mike Rapoport
Hi, On Sun, Sep 06, 2020 at 01:43:21PM +0200, mateusznos...@gmail.com wrote: > From: Mateusz Nosek > > Most fields in struct pointed by 'subscriptions' are initialized explicitly > after the allocation. By changing kzalloc to kmalloc the call to memset > is avoided. As the only new code

[PATCH] mm/mmu_notifier.c: micro-optimization substitute kzalloc with kmalloc

2020-09-06 Thread mateusznosek0
From: Mateusz Nosek Most fields in struct pointed by 'subscriptions' are initialized explicitly after the allocation. By changing kzalloc to kmalloc the call to memset is avoided. As the only new code consists of 2 simple memory accesses, the performance is increased. Signed-off-by: Mateusz