From patchwork Mon May 27 20:55:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 165227 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp7616599ili; Mon, 27 May 2019 13:55:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqwOaWnvStYnw+n9vJRu9CdP+v3V9kFrDTusREpyRZV2ObPZYagDJKh2WgDmEt6Al63n4yhU X-Received: by 2002:a17:90a:730b:: with SMTP id m11mr839930pjk.89.1558990555674; Mon, 27 May 2019 13:55:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558990555; cv=none; d=google.com; s=arc-20160816; b=rhVGlJs7znesRFwEwSNk+nJvIwbBSo/bCx5LO0bXiAhNVLZcUOhE3fh8jMhKeklXB6 5MUIMrO+ygd++pI0T7leXwEgXzP8azA2x/DuUBha8je8OtWn+3+PktbVzxijCW8/jm83 EO9qDYowXTe/Wn0nwF+njTiKOZUFSOUFAls4/DRdfGgM37LzKiDJt7radKy3bvYUCm8f VUz1kL4IbC5CCjNyTnMtUOcTHoOCdUaj3A1hsJCqg3icrliQSzrAWnwoKe8rhYtFWdbQ NdY9x+Y2PO1iG0JhwnKiD9OYY2k+KGewxSkgCr438KmDBPWIlOWA+iCiig0fZTAKevfu rwCQ== 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=D2Cp7f/Qid/by7EIC98tg3BbhOaVwQta3p5eP2Mz3hQ=; b=F5WLBLviZ8Ci8QUUL3QnLvuHKFfZ+ZTKWaJdSpBzl3p18aYJrjy+rx68nZXgoA5R69 z2JA9JgHKGPfAB29jHKzDE9x9s2R7/VR7vi9vS5EE/TsZoit81MWOv8SZYz2+wf+x0ZN o0dsQEZBzaumKRkTv9lEOlhOOk+kwVBmIID+AdT/ufRXS3n0ZiexwtNHmoVrHgyrJNzL VZFQUiHqNzQ8r2AEdfTqL/lVPAiSEM/kdP761g6f+nCMf+KTJRgbWMHhB365I6p0szFf q12Rxw/PeKOw9nUKax0PnjgGzcMQaIjdyV6FCzr1/Musf6wS4jxGulNAiQshFgxbxEGW 2FFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EePZvjMZ; 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: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l27si17850333pgm.172.2019.05.27.13.55.55; Mon, 27 May 2019 13:55:55 -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=EePZvjMZ; 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 S1727383AbfE0Uzw (ORCPT + 30 others); Mon, 27 May 2019 16:55:52 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:35827 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727320AbfE0Uzs (ORCPT ); Mon, 27 May 2019 16:55:48 -0400 Received: by mail-wr1-f67.google.com with SMTP id m3so17972340wrv.2 for ; Mon, 27 May 2019 13:55:46 -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=D2Cp7f/Qid/by7EIC98tg3BbhOaVwQta3p5eP2Mz3hQ=; b=EePZvjMZcgu/kixTEABhJt4zmZ4II7f9mSzF7+7lCB7Jc4MuoxmuTuvlRWq4xGGY3d 28M0CRfZtHnrnjGfsbNmCBnAwnJI7TdO5zojYKV58xxPLtyCf+qaYlQg94txEKEFI7qx TTDo+fIzQYYxfPbdE0se2j2i9RVbv216RwKnsH4NJ6mTAGmJl48ObP4g4u3cm96kUSHU 7su+KIDLSHZsTDCgRYH0U54dWWk/EJ39kDDXzURrwvGMsGu6NUxUgkpybASzQ9u1a220 eWGPiXVVCq4od8z6k/6IFtEuD+ZnR3itJc48TxbeiSefi2CWfCCowpV0PWLcFCp9fm+l G4Hw== 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=D2Cp7f/Qid/by7EIC98tg3BbhOaVwQta3p5eP2Mz3hQ=; b=L1jg19Vhw1/2n5X40wLaVlaVJF/aUR4scbD5suaArcaueybbsExVbFLnguzjmOdcSP I9mINmFUdZpztqLOcXDeamY7VZDcTzx0kyZSALdeEEmhiGfaMxstjKYGpO7+WYTcsqO/ PL8yDEr/Q53V3cbduyaJFgE13EL8knDqJjJrLnGmj3RIL6JAQY5j6xKjRf4wzJdz5LCP Jmv0v/sQ5RWAUboaJJ48oUTTfiAfUPBk4eNtx50dfO9XbJSxp2OyK2JVZ/kqCTcbMpl7 faoJh6CusH29Kj9cMpSKDbedmgnBFQUDoWpfxIhIr3CKqXxu083qsk0EpSI3sx/d0d0D Rr5g== X-Gm-Message-State: APjAAAXKF5YuVxmeP5m74ZCRymBujx4B8UH9N2RqoPfvlv94goQiitdi mTV8k14yigVtmSn1EgrTjzwinpcKwWE= X-Received: by 2002:adf:f2c2:: with SMTP id d2mr1977240wrp.153.1558990546120; Mon, 27 May 2019 13:55:46 -0700 (PDT) Received: from clegane.local (30.94.129.77.rev.sfr.net. [77.129.94.30]) by smtp.gmail.com with ESMTPSA id a1sm388565wmj.23.2019.05.27.13.55.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 May 2019 13:55:45 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, andriy.shevchenko@linux.intel.com Subject: [PATCH V3 4/8] genirq/timings: Encapsulate timings push Date: Mon, 27 May 2019 22:55:17 +0200 Message-Id: <20190527205521.12091-5-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190527205521.12091-1-daniel.lezcano@linaro.org> References: <20190527205521.12091-1-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For the next patches providing the selftest, we do want to artificially insert timings value in the circular buffer in order to check the correctness of the code. Encapsulate the common code between the future test code and the current with an always-inline tag. No functional change. Signed-off-by: Daniel Lezcano --- kernel/irq/internals.h | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) -- 2.17.1 diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h index 70c3053bc1f6..21f9927ff5ad 100644 --- a/kernel/irq/internals.h +++ b/kernel/irq/internals.h @@ -354,6 +354,16 @@ static inline int irq_timing_decode(u64 value, u64 *timestamp) return value & U16_MAX; } +static __always_inline void irq_timings_push(u64 ts, int irq) +{ + struct irq_timings *timings = this_cpu_ptr(&irq_timings); + + timings->values[timings->count & IRQ_TIMINGS_MASK] = + irq_timing_encode(ts, irq); + + timings->count++; +} + /* * The function record_irq_time is only called in one place in the * interrupts handler. We want this function always inline so the code @@ -367,15 +377,8 @@ static __always_inline void record_irq_time(struct irq_desc *desc) if (!static_branch_likely(&irq_timing_enabled)) return; - if (desc->istate & IRQS_TIMINGS) { - struct irq_timings *timings = this_cpu_ptr(&irq_timings); - - timings->values[timings->count & IRQ_TIMINGS_MASK] = - irq_timing_encode(local_clock(), - irq_desc_get_irq(desc)); - - timings->count++; - } + if (desc->istate & IRQS_TIMINGS) + irq_timings_push(local_clock(), irq_desc_get_irq(desc)); } #else static inline void irq_remove_timings(struct irq_desc *desc) {}