Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp914306ybl; Wed, 28 Aug 2019 07:09:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqzl3E3exae953oJm6oegD4I9PPxzst76zf694jCM53/lgIN52xbbtKaapT5oj49NFhCrfzc X-Received: by 2002:a63:6f81:: with SMTP id k123mr3719073pgc.12.1567001359644; Wed, 28 Aug 2019 07:09:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567001359; cv=none; d=google.com; s=arc-20160816; b=WbBVuFNDmO62HJnxVNs22j1JzLxPdbN5fPRrCQETFwJU9mdr7JF3S/ARsvKBuDk0nh Fei+TX0ncP5md1fSfHoYg5LK5YPIiaqZIHP2KC8rLC8rawr3xC61VlqroIDq5ipi9Vkz rwfbk0jeURB9yivAZQDEqb2OekpujcjO6t7iddeWfYt9lXxqYBiVzxwyZi8SCXV411Bd FIF3uKIZY6C2RyCEXukGa/W3k7RyCpx7fiFdSQHVVpz7vyRkoyx0Igmwy1SQESk+N3OX S+8LYAeI5+P1QDqoqdscs0jaAvbaB+qBcoF+wGBHdrK6WAzNLuNWEP/AFg0U/bBQtyQJ Rn/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=VcfGQhx5bnJ6veXwcM8uq4RuWdOrlIE/5NDqRHjnaO4=; b=1FMVk4u3O6DOR9Enw89pzaU89TEoNkivEMasDNZbVXZ34wh9akhq/PEc1WZfYl7b/E qLvKEhWD4Ooen8m3cbEX3TLMDf8ebqS5ySFgZ8cWUmpbtWq574ocJfgeVCpUYAiZdCu3 C7vtJRC3bK9kdOuYcTtjlaEz8KqMobGFU2WxC4DgKjLeXTqZ6MTpoc8jozSPq4VKRXay EEFnjeIrF9XkMZT/JOH07OZjyH5Xqq6VHxRZnL9w1BvemXacG23UE/rZG/u7lqjInORA CSQ7W3UgTEqStgp89EygW3twFb5ABqhrvbQTs0WQSzS8/3vL3o5NmwPg4p92w2Fr7U0z yF4Q== 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 v6si1958253plp.4.2019.08.28.07.09.03; Wed, 28 Aug 2019 07:09:19 -0700 (PDT) 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 S1726719AbfH1OH6 (ORCPT + 99 others); Wed, 28 Aug 2019 10:07:58 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:47429 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726410AbfH1OH6 (ORCPT ); Wed, 28 Aug 2019 10:07:58 -0400 Received: from [5.158.153.52] (helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1i2ybc-0005Vf-Ga; Wed, 28 Aug 2019 16:07:24 +0200 Date: Wed, 28 Aug 2019 16:07:19 +0200 (CEST) From: Thomas Gleixner To: Ming Lei cc: LKML , Long Li , Ingo Molnar , Peter Zijlstra , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , John Garry , Hannes Reinecke , linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, Daniel Lezcano Subject: Re: [PATCH 1/4] softirq: implement IRQ flood detection mechanism In-Reply-To: <20190828135054.GA23861@ming.t460p> Message-ID: References: <20190827085344.30799-1-ming.lei@redhat.com> <20190827085344.30799-2-ming.lei@redhat.com> <20190827225827.GA5263@ming.t460p> <20190828110633.GC15524@ming.t460p> <20190828135054.GA23861@ming.t460p> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 28 Aug 2019, Ming Lei wrote: > On Wed, Aug 28, 2019 at 01:23:06PM +0200, Thomas Gleixner wrote: > > On Wed, 28 Aug 2019, Ming Lei wrote: > > > On Wed, Aug 28, 2019 at 01:09:44AM +0200, Thomas Gleixner wrote: > > > > > > Also how is that supposed to work when sched_clock is jiffies based? > > > > > > > > > > Good catch, looks ktime_get_ns() is needed. > > > > > > > > And what is ktime_get_ns() returning when the only available clocksource is > > > > jiffies? > > > > > > IMO, it isn't one issue. If the only clocksource is jiffies, we needn't to > > > expect high IO performance. Then it is fine to always handle the irq in > > > interrupt context or thread context. > > > > > > However, if it can be recognized runtime, irq_flood_detected() can > > > always return true or false. > > > > Right. The clocksource is determined at runtime. And if there is no high > > resolution clocksource then that function will return crap. > > This patch still works even though the only clocksource is jiffies. Works by some definition of works, right? > > Well, yes. But it's trivial enough to utilize parts of it for your > > purposes. > > >From the code of kernel/irq/timing.c: > > 1) record_irq_time() only records the start time of one irq, and not > consider the time taken in interrupt handler, so we can't figure out > the real interval between two do_IRQ() on one CPU I said utilize and that means that the infrastructure can be used and extended. I did not say that it solves your problem, right? > 2) irq/timing doesn't cover softirq That's solvable, right? > Daniel, could you take a look and see if irq flood detection can be > implemented easily by irq/timing.c? I assume you can take a look as well, right? Thanks, tglx