Received: by 10.223.148.5 with SMTP id 5csp6790118wrq; Wed, 17 Jan 2018 19:10:18 -0800 (PST) X-Google-Smtp-Source: ACJfBouT5efBHHKgYizRnAs450FWU/Ht6hcL1spUygt1r6u0wWG7OJUz/7LED/iTDa7M5MsjJqQg X-Received: by 10.101.64.196 with SMTP id u4mr1564407pgp.336.1516245018078; Wed, 17 Jan 2018 19:10:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516245018; cv=none; d=google.com; s=arc-20160816; b=rQEQtWlLOWcnpXvaeTaIKaShLBWcr1N403aZTvyI5nwKLhLeP72aM7nj4j+5Vuut4w 2LCTQ9aG6lJfL3cn7eQce+dlWgKkAoXZ01JQVVCTMKESJmYFJGp2VSO5TnyifwvYz1q+ XymzWQf5wiuVJWF8WtMe+flshqt3pF9zKO8ZlKW6LADWovOxGGt0zJcNgz8j+BmgU5aD wL7jwfaAu5gCukjbDc6Wt16So1MHC9MjehZNrnyiF7DCTdbrc8TUN2nuHYUd00REmHMw S2xZ65ROjvTDA052rK5Wlvzy29qqVIKW28qIBwOyHyEmzWDhfLlxfMuTjw/M3Vd1MKYG 2TLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=EJCOCi8WWoXtU7UhFQSaH8q5X8+IEVbBp4aCzwnpol4=; b=uOgGKLS24xYyr0KAoXhs4WqOL/b7zRb5ima0UAZNpJBdzsRlgZRtEJihyLpz/qJoED 8qipW5UlNO4+AdVLMCrD2Gnh1mvahcaooe/+rmwDfpr6DIWUJqEoDeDhe6UuRXY6udzu CjQVrOIQZybTyTrPEGIGY8iRkv7Lu3oiXWPDwFWK9q6VIjvCa2gQViPWAsAi5wDdrHyo /JGfTKUMw6KOpr8NJcGmc/Mil1ih+3ABc2JOE2tbhwPtm2CRX7ILsiyYwyhewPgxGHxM W18lFoD6IREIvInDpejZaeC556P3VJoyZ+UM0jRTXqhqhRS8evsDaIv0UW53GoOOPdCb usgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=JKP/vjo4; 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 z21si3241269plo.453.2018.01.17.19.10.03; Wed, 17 Jan 2018 19:10:18 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=JKP/vjo4; 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 S1753531AbeARDJl (ORCPT + 99 others); Wed, 17 Jan 2018 22:09:41 -0500 Received: from mail-io0-f178.google.com ([209.85.223.178]:39810 "EHLO mail-io0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752403AbeARDJk (ORCPT ); Wed, 17 Jan 2018 22:09:40 -0500 Received: by mail-io0-f178.google.com with SMTP id b198so20564736iof.6 for ; Wed, 17 Jan 2018 19:09:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=EJCOCi8WWoXtU7UhFQSaH8q5X8+IEVbBp4aCzwnpol4=; b=JKP/vjo4F5XnokcdZXqRdPfSv1n2I6/hjO/n2aIaD+F4kqVfRnnGtHcKyWNQmfzqWf UBigLMxZmKI4aGepQqQ+EO5urCdkAJg8lgJg/Jrs9p8nBsmvwwaqJ7wwohti0MGslrNe VXbEZQk3VyPCJGNenTeU/SrbIkHPNZZXGKzt2HdUgO2SNhgh/lyXHfeLCYrjyZ38IUaY dHjC6gg+nPpE2+N7ArFJmcO7hFPyBe9BvKeG83+k/padnxBQvEnKVI6GDl/CoN73kuiB p9gn6heNzcjmcf2OT26wwHBKEfN8yEuI6jqRfNV4kVofmcU8Pz9uDM6WtDgU9H+wC91l /aVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=EJCOCi8WWoXtU7UhFQSaH8q5X8+IEVbBp4aCzwnpol4=; b=qKiL/GEIkMx+6s53jY5ZBF99rz/06OvS7ttic8CXX44Ers3KETaFzu8AAxV5QLAOkw cJmHCCF1lQlhiJPpVN4ArvSeAjQFZO54GWVEDWlUxFeapfaNi4utuXD4AqFcdz8dab8U Xg9JgaT36rc3hS9YP0+QSlD0m/EN1xioC/8IJvYzeepH3sSJ3FrK7EClFWPpFOZd6dSG uSnr98vXuLvgE8twVM+iYVDSs94EpWvIdEU/3+G8wljYRt303h+3PKr6KzQBo5WbuyCw naWWSUaQXPNlB/9QxI5OC2UXifAZhxY08tGBaLJBz9fQLzRbYAJUzhD2JlRU/U7Hjluj 4MPg== X-Gm-Message-State: AKGB3mJMyW0Flq5W486WsES01kJEABjjVvvHd4N+t+GD41BHDdJUQ31a N5aL+zKodtViOgk9stiojIRUHO1rqLdvFZg3ylA= X-Received: by 10.107.13.12 with SMTP id 12mr46362836ion.174.1516244979711; Wed, 17 Jan 2018 19:09:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.6.147 with HTTP; Wed, 17 Jan 2018 19:09:39 -0800 (PST) In-Reply-To: <20180118025539.GA20310@lerouge> References: <1516077640-19718-1-git-send-email-frederic@kernel.org> <20180117145620.213cb5ad@vento.lan> <20180117180713.GA17735@lerouge> <20180118025539.GA20310@lerouge> From: Linus Torvalds Date: Wed, 17 Jan 2018 19:09:39 -0800 X-Google-Sender-Auth: JrXn1Oe-OP0SPXOEVQ0auMESlUg Message-ID: Subject: Re: [RFC PATCH 0/5] softirq: Per vector threading v2 To: Frederic Weisbecker 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 Content-Type: text/plain; charset="UTF-8" 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 6:55 PM, Frederic Weisbecker wrote: >> 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 :) Oh, miscommunication. I tried to suggest to do things purely by time (from an accounting standpoint), but then to also have some "minimum time" for each invocation, so that there effectively ends up being an invocation limit too. Honestly, that's mainly because I worry about just how good the time-based approach might be (ie some hardware doesn't have a good high-frequency clock to read etc. On x86-64, the TSC would be fairly natural as a clock, but we support architectures without anything like that, so time-based definitely has some issues. But thinking about it more, I do end up liking my suggested "just keep a bitmap of softirqs that have been handled" thing, and kick the softirq to a thread if it ever seems to get into that "we already saw this one". It might just work very naturally, and it sure as hell is simple and has no subtle interactions with the granularity of whatever random clock the architecture or platform has. It should never trigger under any normal load, but I think it *should* trigger under the load that the networking people worry about. If you get a flood of UDP packets, and spend a lot of time in softirqs, I'm pretty sure you'd hit that case of seeing the same softirq re-raised fairly naturally and quickly. Linus