Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3225435rdh; Thu, 28 Sep 2023 06:21:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFM4jv/IQWDdQg1m9juRhsD5UeUEYijrHEP7npS9eK4qr45hdPdBJw2HuIBGM8eLRtE2VW0 X-Received: by 2002:a05:6870:c1cb:b0:1dc:a72c:5ce9 with SMTP id i11-20020a056870c1cb00b001dca72c5ce9mr1237040oad.4.1695907287785; Thu, 28 Sep 2023 06:21:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695907287; cv=none; d=google.com; s=arc-20160816; b=cIXm9CQHv3HF2LL9t4bh7gZ2kGeodNzRfB9lzy73nba4LaGrWPMHtezshbBGQ7z0gK a+Hgp5HEx1t1D04gGqk4onbKsjVi89HqcmATFMRYlxGlAgZQcWAkTZVpwWpWRyHjdcQg 632T2dSZ/SrILBTJRGOhD67N4WPtFyn7hUXFVTvCfjeCKJ/QCc+xVC2MthKeuv/+OtrE 83qLcxPqfMc8seY1It7GWcJMt0vmCyaexedAFNdWsmjFdlgT/icYXI8lBoPUFJDRKUfy y6slWApUDpJRUt1igv23zeaWKcGKOSJtJFCoXXzEYFbH3306IyAqU0ZwzKK3E+qsZJlC Xq2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=YzjhCOHnVrOWVu3L5BYh5+IXRIcy2pH3k0v3ndT/lxQ=; fh=tU5RGVrhWgtavFjSItONQ1u03yDdlHJ9ig8MCmmkygU=; b=quZNfV3bSeufe4syYR6i5ITbSgt6PQHHrYlo7Y4SRJV65TmiqJDBidstpvge0URuX2 h1Gsy3A/r0NyjOZ7uiaEJaPVF2NLwf0mqhpNd00qqIUEaSPdFUnaYBrooi1xb2znUJeZ 7E+KH6CusSUFXgT9AcrU+x+f5uEe+gRoRQ8Fnj78yXDzbtTMFJ4lwawaCYy4QZgEuwvU evmiDWgdlEI/qrvPtWkd4uptTAZBZTh9aPDmBiPEjJc0/CHX1KtLLE1WMZfSr/dcEYyq h3n6nJ6711ZTxK2M4VkNHxI3m+55pPhLN7DE8g7XFhmr1cKua6kZRpBWF75TH1V7Yr+w EN6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=dKZhPIHc; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=70MgudQg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id bk13-20020a056a02028d00b00584ac83e116si7930894pgb.321.2023.09.28.06.21.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 06:21:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=dKZhPIHc; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=70MgudQg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 709DB80401F7; Thu, 28 Sep 2023 02:28:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231624AbjI1J2Q (ORCPT + 99 others); Thu, 28 Sep 2023 05:28:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231615AbjI1J2P (ORCPT ); Thu, 28 Sep 2023 05:28:15 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68FEFAC for ; Thu, 28 Sep 2023 02:28:13 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1695893291; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YzjhCOHnVrOWVu3L5BYh5+IXRIcy2pH3k0v3ndT/lxQ=; b=dKZhPIHcElXNxGS8THs4uvYfHwZ0aDzq5rpvddM0GIB+PpypbIYAjKvg2wlwCT2Q1xEjTi +xqfds0SdCrxlgOx7HEw5FPOJwhnQaEjFNHU1wlvyScxDX3zFny2Kb5vxA5x8hbGabyvT2 1oqSUcY99f8svb2F87tRprO7TDxbG02wrm+7JwTIwXFKjT7hVvVYap7O2o1Js1yUFMvkK/ HrCGktQzPbzMEQqRh66BKAYGYiWpwFjHxdFN19vv9R6597kf3tUwiYKY9ixqJfk+4v8eWR NNSjBj88Qt/FjIBrUsaEg+e2QDSazRfh+hLVBM1tWDamhb+35EAeXdNaBRU3hw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1695893291; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YzjhCOHnVrOWVu3L5BYh5+IXRIcy2pH3k0v3ndT/lxQ=; b=70MgudQgIU0oyenS2bcXWUrrgHk8f3TaVcpqZpDBvb2IUjxIuLvtEPjCF5G3243+V8qJoT l6vlLMD1u44vJcDg== To: Wei Gong Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] genirq: avoid long loops in handle_edge_irq In-Reply-To: References: <20230925025154.37959-1-gongwei833x@gmail.com> <87msx9f7a2.ffs@tglx> <87edijfxjv.ffs@tglx> Date: Thu, 28 Sep 2023 11:28:10 +0200 Message-ID: <87bkdmfxzp.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 28 Sep 2023 02:28:37 -0700 (PDT) On Thu, Sep 28 2023 at 10:22, Wei Gong wrote: > On Wed, Sep 27, 2023 at 05:25:24PM +0200, Thomas Gleixner wrote: >> On Wed, Sep 27 2023 at 15:53, Wei Gong wrote: >> > O Tue, Sep 26, 2023 at 02:28:21PM +0200, Thomas Gleixner wrote: >> >> On Mon, Sep 25 2023 at 10:51, Wei Gong wrote: >> >> > diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c >> >> > index dc94e0bf2c94..6da455e1a692 100644 >> >> > --- a/kernel/irq/chip.c >> >> > +++ b/kernel/irq/chip.c >> >> > @@ -831,7 +831,8 @@ void handle_edge_irq(struct irq_desc *desc) >> >> > handle_irq_event(desc); >> >> > >> >> > } while ((desc->istate & IRQS_PENDING) && >> >> > - !irqd_irq_disabled(&desc->irq_data)); >> >> > + !irqd_irq_disabled(&desc->irq_data) && >> >> > + cpumask_test_cpu(smp_processor_id(), irq_data_get_affinity_mask(&desc->irq_data))); >> >> >> >> Assume affinty mask has CPU0 and CPU1 set and the loop is on CPU0, but >> >> the effective affinity is on CPU1 then how is this going to move the >> >> interrupt? >> > >> > Loop is on the CPU0 means that the previous effective affinity was on CPU0. >> > When the previous effective affinity is a subset of the new affinity mask, >> > the effective affinity will not be updated. >> >> That's an implementation detail of a particular interrupt chip driver, >> but not a general guaranteed behaviour. >> > > Can replacing irq_data_get_affinity_mask with irq_data_get_effective_affinity_mask > solve this issue? Yes.