Message ID | 20190513102953.16424-4-daniel.lezcano@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1141242ili; Mon, 13 May 2019 03:30:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZEDal5C67h2v7LLf/SL9hjOH4ewJ1UbipUstUKcqcDwlkZNTa9jSFhxaSb7qQ4bM0rkk5 X-Received: by 2002:a62:7d8e:: with SMTP id y136mr9817363pfc.224.1557743412811; Mon, 13 May 2019 03:30:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557743412; cv=none; d=google.com; s=arc-20160816; b=aVBhtogi646UyuIZwBS2rucNQ0yk0MgSrDMAz2FOFJV8tOaHbfqO71yhMwNf8q/KrY XVP/zglVZJaF5rpM8GDstH0oLNgyGK03w/mEe+KsZu1P5Wey0zv1abQhPWdpxg1dBfSs 2xIXT8ZlmsDw9U7Kr20odylLYT425t/KxvX6Wwg2bN2026QLfTF4Gr76dYpIznhq/mT8 gXNdravxDwy56md1r6AyRz+f1tmq2FGjWrUalqcGE6X3mkg6a7XUQJ0kML1PoapDb8sJ Gtim9yeaejXxpvyAleMeSbztLIAPuS00V3m+Yyh4Yk4zsQGLsvppZtB/MhLkHqQ8vO5/ Q5ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=L7Wy/UoR346yun6rGdrn0w0Sk7Zt+3JLoV24BHUfklw=; b=XJW+KCw+u+y5fooHMs2rYEkM1Z7zEzqsWbPB4WWdBiD6TrdXNkGY8dMXZ+5wHzLrjh vTb7sZh+N7Ktc4a1aoaKKJKrKbMu9Lr2+UgbCIYyoptSnkbLHzR94OdA+mLGx6Ek+sRX RKicAWbKHvuJ+ZckD9wsKrFdSrE59JGQ0j5ZxggLNP3a55h7R6T8yf4gPW9y5k4iIrWT TnY2ZATjC9EUF+UHw+K3uItPpWOu1/1K52Oc1vmo2s7WgQg8qj0PVfagefOoLAmposfR MxkGFKvvXaf/i+8GlRMBFsOsaOfG31S6C8dwnxZDuOei9LBkRiZtvJpHCSyoVZgckQhx D6Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KaMLGxq5; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: <linux-kernel-owner@vger.kernel.org> Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9si15649572pgw.14.2019.05.13.03.30.12; Mon, 13 May 2019 03:30:12 -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; dkim=pass header.i=@linaro.org header.s=google header.b=KaMLGxq5; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728607AbfEMKaL (ORCPT <rfc822;mike.holmes@linaro.org> + 30 others); Mon, 13 May 2019 06:30:11 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:43619 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728118AbfEMKaJ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 13 May 2019 06:30:09 -0400 Received: by mail-wr1-f66.google.com with SMTP id r4so14588532wro.10 for <linux-kernel@vger.kernel.org>; Mon, 13 May 2019 03:30:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=L7Wy/UoR346yun6rGdrn0w0Sk7Zt+3JLoV24BHUfklw=; b=KaMLGxq5Wb940wNjeO7BJOduBqFwHX0vgpSfCZ+93hfjbyg7qWJg271Pn/VKXyd39w bQCBsUYg1VvXJegV31qG8hLePpv0czgoGzUEMs4phtmeD/zmUC1nfEQJC8ogw28eG2bk +An7yw8256pDJcinE/m0XLNIcmUeUAE4y2m9c4gUA0k5QBEPJpb+AkdYJlChJ+5gw1t3 tSRK6T23ZWmmujbo1eRKJF1zxUdU34dcaU/iPR3nEkUY5wwIkPRxWuJTrBBYsQt6fL3P gSTqWb24e4RuKL5Jy3Dqu9SzUr4XxOABGUldg3IeYOApTUZlwsQTBHDdGq6GsTBGut5c 4IrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=L7Wy/UoR346yun6rGdrn0w0Sk7Zt+3JLoV24BHUfklw=; b=NcpAtH/VZizNdO8a7DFvFEvnwlSa3C70cS/jXBfiTn/U0drxwA18U6rJbb9jMDMrVq 5xRLSnZ8raN8vF/fTlnd83X8vxgjfHtTJGx3pItWJKatTSAP18Hxe8Uj6/wzEUogmidk xVn5diRwfMpkJjwormgZT1zumsJVoG8/HodDzO6+wyrMb9GacadJDdsHJbtIXmz770z8 PWa3hTp+MxVJt937WjvQnUTeatjXBQ41CqPT9y73gwttv5hahtzbOw1pVkBM3DvoPArk WbCUnwTfYL4YDahPyrURcAGkX/KbhVmEsrmTT30ZZlRbENhQoh/g80KDm99LTEV/e/Gx D0dg== X-Gm-Message-State: APjAAAUdIqXNF8q6mAAdQwCY0XRzoIjCvaSePquo9GPrUz9HbnG7MK9h f1VZxvqBDdKee1yAskBv3rLO2g== X-Received: by 2002:a05:6000:1209:: with SMTP id e9mr16196807wrx.205.1557743407366; Mon, 13 May 2019 03:30:07 -0700 (PDT) Received: from clegane.local (205.29.129.77.rev.sfr.net. [77.129.29.205]) by smtp.gmail.com with ESMTPSA id v192sm13645238wme.24.2019.05.13.03.30.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 May 2019 03:30:06 -0700 (PDT) From: Daniel Lezcano <daniel.lezcano@linaro.org> To: tglx@linutronix.de Cc: linux-kernel@vger.kernel.org Subject: [PATCH 3/9] genirq/timings: Optimize the period detection speed Date: Mon, 13 May 2019 12:29:47 +0200 Message-Id: <20190513102953.16424-4-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190513102953.16424-1-daniel.lezcano@linaro.org> References: <20190513102953.16424-1-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org |
Series |
genirq/timings: Fixes and selftests
|
expand
|
diff --git a/kernel/irq/timings.c b/kernel/irq/timings.c index 250bb00ccd85..06bde5253a7d 100644 --- a/kernel/irq/timings.c +++ b/kernel/irq/timings.c @@ -261,7 +261,7 @@ void irq_timings_disable(void) #define EMA_ALPHA_VAL 64 #define EMA_ALPHA_SHIFT 7 -#define PREDICTION_PERIOD_MIN 2 +#define PREDICTION_PERIOD_MIN 3 #define PREDICTION_PERIOD_MAX 5 #define PREDICTION_FACTOR 4 #define PREDICTION_MAX 10 /* 2 ^ PREDICTION_MAX useconds */
If we have a minimal period and if there is a period which is a multiple of it but lesser than the max period then it will be detected before and the minimal period will be never reached. 1 2 1 2 1 2 1 2 1 2 1 2 <-----> <-----> <-----> <-> <-> <-> <-> <-> <-> In our case, the minimum period is 2 and the maximum period is 5. That means all repeating pattern of 2 will be detected as repeating pattern of 4, it is pointless to go up to 2 when searching for the period as it will always fail. Remove one loop iteration by increasing the minimal period to 3. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> --- kernel/irq/timings.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1