From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753256AbcFJPa5 (ORCPT ); Fri, 10 Jun 2016 11:30:57 -0400 Received: from www.linutronix.de ([62.245.132.108]:35623 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752101AbcFJPa4 (ORCPT ); Fri, 10 Jun 2016 11:30:56 -0400 Date: Fri, 10 Jun 2016 17:30:51 +0200 From: Sebastian Andrzej Siewior To: Steven Rostedt Cc: LKML , linux-rt-users , netdev , Thomas Gleixner , Peter Zijlstra , Clark Williams , Eric Dumazet , David Miller , alison@peloton-tech.com Subject: Re: [PATCH][RT] netpoll: Always take poll_lock when doing polling Message-ID: <20160610153051.GA10775@linutronix.de> References: <20160526195641.6c26e979@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160526195641.6c26e979@gandalf.local.home> X-Key-Id: 2A8CF5D1 X-Key-Fingerprint: 6425 4695 FFF0 AA44 66CC 19E6 7B96 E816 2A8C F5D1 User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Steven Rostedt | 2016-05-26 19:56:41 [-0400]: >For example: > > > > napi_schedule_prep() > test_and_set_bit(NAPI_STATE_SCHED, &n->state) > > > > sk_busy_loop() > > do { > rc = busy_poll() > ret = napi_schedule_prep() > return !test_and_set_bit(NAPI_STATE_SCHED, &n->state) > > if (!ret) return 0 > > } while (...) /* for ever */ > No, I don't see the busyloop. while() is here: | while (!nonblock && skb_queue_empty(&sk->sk_receive_queue) && | !need_resched() && !busy_loop_timeout(end_time)); and this seems to be the case since v3.11 where it was introduced (but now it moved to dev.c). So even if there is no busy_poll() and napi_schedule_prep() returns 0 our cycles here are limited by busy_loop_timeout(). Sebastian