netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] percpu: add a schedule point in pcpu_balance_workfn()
@ 2018-02-23 16:12 Eric Dumazet
  2018-02-23 16:53 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2018-02-23 16:12 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-kernel, netdev

From: Eric Dumazet <edumazet@google.com>

When a large BPF percpu map is destroyed, I have seen
pcpu_balance_workfn() holding cpu for hundreds of milliseconds.

On KASAN config and 112 hyperthreads, average time to destroy a chunk
is ~4 ms.

[ 2489.841376] destroy chunk 1 in 4148689 ns
...
[ 2490.093428] destroy chunk 32 in 4072718 ns

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 mm/percpu.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/percpu.c b/mm/percpu.c
index 50e7fdf84055151d8c7e8bb220f7a73e96b7f3e4..d40dfb597ffce2656220257f0227219ab917135b 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -1600,6 +1600,7 @@ static void pcpu_balance_workfn(struct work_struct *work)
 			spin_unlock_irq(&pcpu_lock);
 		}
 		pcpu_destroy_chunk(chunk);
+		cond_resched();
 	}
 
 	/*

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] percpu: add a schedule point in pcpu_balance_workfn()
  2018-02-23 16:12 [PATCH] percpu: add a schedule point in pcpu_balance_workfn() Eric Dumazet
@ 2018-02-23 16:53 ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2018-02-23 16:53 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: linux-kernel, netdev

On Fri, Feb 23, 2018 at 08:12:42AM -0800, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> When a large BPF percpu map is destroyed, I have seen
> pcpu_balance_workfn() holding cpu for hundreds of milliseconds.
> 
> On KASAN config and 112 hyperthreads, average time to destroy a chunk
> is ~4 ms.
> 
> [ 2489.841376] destroy chunk 1 in 4148689 ns
> ...
> [ 2490.093428] destroy chunk 32 in 4072718 ns
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Applied to percpu/for-4.16-fixes.

Thank, Eric.

-- 
tejun

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-02-23 16:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-23 16:12 [PATCH] percpu: add a schedule point in pcpu_balance_workfn() Eric Dumazet
2018-02-23 16:53 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).