Skip to content

Commit a1aaee7

Browse files
edumazetdavem330
authored andcommitted
net: make napi_threaded_poll() aware of sd->defer_list
If we call skb_defer_free_flush() from napi_threaded_poll(), we can avoid to raise IPI from skb_attempt_defer_free() when the list becomes too big. This allows napi_threaded_poll() to rely less on softirqs, and lowers latency caused by a too big list. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent e6f50ed commit a1aaee7

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

net/core/dev.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6622,18 +6622,21 @@ static void skb_defer_free_flush(struct softnet_data *sd)
66226622
static int napi_threaded_poll(void *data)
66236623
{
66246624
struct napi_struct *napi = data;
6625+
struct softnet_data *sd;
66256626
void *have;
66266627

66276628
while (!napi_thread_wait(napi)) {
66286629
for (;;) {
66296630
bool repoll = false;
66306631

66316632
local_bh_disable();
6633+
sd = this_cpu_ptr(&softnet_data);
66326634

66336635
have = netpoll_poll_lock(napi);
66346636
__napi_poll(napi, &repoll);
66356637
netpoll_poll_unlock(have);
66366638

6639+
skb_defer_free_flush(sd);
66376640
local_bh_enable();
66386641

66396642
if (!repoll)

0 commit comments

Comments
 (0)