From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932440AbcEKPuP (ORCPT ); Wed, 11 May 2016 11:50:15 -0400 Received: from mail-pa0-f65.google.com ([209.85.220.65]:36194 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751605AbcEKPuN (ORCPT ); Wed, 11 May 2016 11:50:13 -0400 Message-ID: <1462981808.23934.145.camel@edumazet-glaptop3.roam.corp.google.com> Subject: Re: [RFC PATCH 0/2] net: threadable napi poll loop From: Eric Dumazet To: Eric Dumazet Cc: Hannes Frederic Sowa , Peter Zijlstra , Paolo Abeni , netdev , "David S. Miller" , Jiri Pirko , Daniel Borkmann , Alexei Starovoitov , Alexander Duyck , Tom Herbert , Ingo Molnar , Rik van Riel , LKML Date: Wed, 11 May 2016 08:50:08 -0700 In-Reply-To: References: <1462890590.23934.68.camel@edumazet-glaptop3.roam.corp.google.com> <90f3db8c-c30c-b204-576a-454939ac93ce@stressinduktion.org> <94f323a9-515e-4d75-cac8-ef0214f0499e@stressinduktion.org> <1462920697.23934.113.camel@edumazet-glaptop3.roam.corp.google.com> <20160511065527.GD3193@twins.programming.kicks-ass.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2016-05-11 at 07:40 -0700, Eric Dumazet wrote: > On Wed, May 11, 2016 at 6:13 AM, Hannes Frederic Sowa > wrote: > > > This looks racy to me as the ksoftirqd could be in the progress to stop > > and we would miss another softirq invocation. > > Looking at smpboot_thread_fn(), it looks fine : > > if (!ht->thread_should_run(td->cpu)) { > preempt_enable_no_resched(); > schedule(); > } else { > __set_current_state(TASK_RUNNING); > preempt_enable(); > ht->thread_fn(td->cpu); > } BTW, I wonder why we pass td->cpu as argument to ht->thread_fn(td->cpu) This always should be the current processor id. Or do we have an issue because we ignore it in : static int ksoftirqd_should_run(unsigned int cpu) { return local_softirq_pending(); }