Received: by 10.223.148.5 with SMTP id 5csp6777565wrq; Wed, 17 Jan 2018 18:56:55 -0800 (PST) X-Google-Smtp-Source: ACJfBou6Wj4iCJxUhCmjsTVtNiaOufN92ksgfbxIrWNFXMmdY0rFzG9il890BuPd8t4nB+cnhD/E X-Received: by 10.99.107.73 with SMTP id g70mr17653194pgc.281.1516244214905; Wed, 17 Jan 2018 18:56:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516244214; cv=none; d=google.com; s=arc-20160816; b=mCVG6l7JKE6YFc2DfjB7um+DKvLgs7gcXgKlzDBI6bxNdE4rEJQutDAzo4aXyuMMYC wsUR4qljua0MRTcaiHwXVmMpbf87IFdEiSSdJ/A58J258wRm0d5+Wr+59sZiaXxvMrzX Iio4YLRKck2a36ZG4Y+YG1x2rJ+kbHF5oZB7JeldVRa6pPPQ3iZG3Dudm7XWCHctUHOD M/4B/AHMXfDsn6zuC/upVOX+0AG8EJLZjx0JgxpKUKZTc8ahV+4dVac93hLXHgQWD/hX BAIzIdP81bEqOGCouhvGUKnlLEyMqbnTBm2ee53Hq+srU4EkE0W7E5Ert8XglO43EEwH 1vqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dmarc-filter:arc-authentication-results; bh=y4ro/WnlKkqCJtmy6KynNsobi8L22UUh64GiRQNfFUQ=; b=g5mdUAuOr5D1ZipqgsD70QEUOfYGU0WJFWtmJ4J6KZij8xKXN3/l7q5qmJ5jmSgn3V 4gP7BiwL2nq9tzBD6RQUaamIeVBXApjaPlTcKV0qsixJDdEVOi7DJsXiEF3igdOeiMB6 mWV5lhsizeaQy5Wqmnlca2DOhp8nZr5eAIv9t/xRMbr/1xLb0gfJ5x4iNwCpdQ8olgcE y1qeZjyGixByQYhGeUM6n04UUt+a0Qs2im8uZa12huvinDBYkvqKiM79Ih4FPK0Z4lTP JKBayRLaZVhKL0R4NPmXVCQ3hlo9b8azwV9Jmrthna00EJoIx7FaszqrppawWeJnt/rI Aygw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c3si5787930plr.495.2018.01.17.18.56.41; Wed, 17 Jan 2018 18:56:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753412AbeARCzq (ORCPT + 99 others); Wed, 17 Jan 2018 21:55:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:58724 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752403AbeARCzp (ORCPT ); Wed, 17 Jan 2018 21:55:45 -0500 Received: from localhost (i16-les03-th2-31-37-47-191.sfr.lns.abo.bbox.fr [31.37.47.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8B74B2175B; Thu, 18 Jan 2018 02:55:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B74B2175B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=frederic@kernel.org Date: Thu, 18 Jan 2018 03:55:41 +0100 From: Frederic Weisbecker To: Linus Torvalds Cc: Mauro Carvalho Chehab , LKML , Levin Alexander , Peter Zijlstra , Hannes Frederic Sowa , "Paul E . McKenney" , Wanpeng Li , Dmitry Safonov , Thomas Gleixner , Eric Dumazet , Radu Rendec , Ingo Molnar , Stanislaw Gruszka , Paolo Abeni , Rik van Riel , Andrew Morton , David Miller Subject: Re: [RFC PATCH 0/5] softirq: Per vector threading v2 Message-ID: <20180118025539.GA20310@lerouge> References: <1516077640-19718-1-git-send-email-frederic@kernel.org> <20180117145620.213cb5ad@vento.lan> <20180117180713.GA17735@lerouge> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 17, 2018 at 03:56:43PM -0800, Linus Torvalds wrote: > On Wed, Jan 17, 2018 at 10:07 AM, Frederic Weisbecker > wrote: > > > > I see, so you may want to test (possibly much) higher values of MAX_SOFTIRQ_RESTART, > > such as 50 or 100. > > I suspect the "number of softiqs per jiffy" is hardly interesting at all. > > We used to allow up to 2mS or ten iterations per _invocation_, never > mind per timer tick. > > I thought you were going to actally account for time, but I don't > think you ended up doing that. I did in the first version but then I thought you suggested that count per jiffy. I probably misunderstood :) > > Maybe time isn't necessarily the thing to do, but just pure "count per > jiffy" seems very bad. Indeed, the more I think about it, the more doubts I have too. At least I started to think that this metric alone is not enough. > > What I might suggest using instead: > > - do it by time. This may be too expensive, though. Keeping track of > ns-level timing per invocation can be nasty. Yeah I would like to avoid that if we can. I guess it's ok if it sums up to rdtsc but I fear it's common to have a heavier version. > > - do it by "we got a new softirq event while handling another softirq > event". That was our old count per invocation, except you could do it > per softirq, and just allow *one* (ie keep a bitmask of "I've already > handled this softirq", and if the restart results in it being > triggered *again* you say "ok, I'll just move this to a workqueue" That one is very tempting. > > - .. something else? > > I'd suggest trying the "if we get a new softirq event that we've > already seen while we were already handling softirq events" thing. > That should really take care of the networking case of "90% time spend > in softirq handling during packet storms" thing. If we spend that much > time on softirqs, we *will* get a new softirq while handling an old > one occasionally. Ok I'm going to try that for the v3. Thanks.