Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp880009pxb; Fri, 22 Apr 2022 13:17:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYp/g9WvabyVF3HVQzh91nnMNerDIe6jLG/7Y3/M9RlBr47spHXdiSwAOEBxyv9RbrwnF1 X-Received: by 2002:a17:90a:9109:b0:1cb:a814:8947 with SMTP id k9-20020a17090a910900b001cba8148947mr17833196pjo.52.1650658678149; Fri, 22 Apr 2022 13:17:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650658678; cv=none; d=google.com; s=arc-20160816; b=bfIPI0sBut0bDGt/+98T/z25GSGKeYQ6xHzakt2T1FN4abFXdhHIGILjDGabva0Ypf QbDM9auBLftW/yvN4YmQJnu+HkgM3U8Wqu/DVOZcL72mWeMIWl72jSN/OSkxOblyT+aK sobWEyG5+ffywGR9dPpsSQUUPIVt4aMeRNN/2cbQPkQvtg6Lb9DqtIqmZ4WaUdeVXF/E ZGAanhMj5d2u4U7JvT0+BUcogzOyI5A01y6OVvi9m6pEzp2E8o22A5K23lmVCweZZewD qg9NL2m0V8n4gR2hPQjRKnTLlyUjdgw0v+IRjgNOyEgqNHyme7i5VP4sRrsdNxikVZii XeqQ== 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=Co+vGxQAnvjE28xN2iS2qSyvQ7+qNi2mwvNPw4R/fZk=; b=bkcdZWIcL4bgvMGebC3wVNhR03NSfP+bXzMMy83/nPly946uwMAWYdEt7N6JdAPk9Y Q0+WE5TPtsk7S2smRXjjfzqGV7vQeCemhhEVzLuTAZSa3WQyMjHwxqlvLgRG7TR1v6sc yqopn3W/oKedMMcsoIZojmLmukdXqNKnx6wBK0B1eFKjcdHh/5UOoPeOQbomVn1WQFEW v8FkOnI3F62bxOc70Mn3hB8MUBVDZNxk4jr19Pt4hgVtNCVkOC68fMjkaQUlge0ZdCpx 0hiKvWlK5foYNdSWHVifjzKS+XFyybiJG1eMzWEoTC3cAYSZ1VNRGhdfpQc/7ltVrfM9 NRKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=BaypSsIz; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l8-20020a635708000000b003817672f2d4si9560704pgb.316.2022.04.22.13.17.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 13:17:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=BaypSsIz; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 69D2329C208; Fri, 22 Apr 2022 12:22:17 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1390737AbiDUQ1P (ORCPT + 99 others); Thu, 21 Apr 2022 12:27:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231180AbiDUQOs (ORCPT ); Thu, 21 Apr 2022 12:14:48 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF7E42B241 for ; Thu, 21 Apr 2022 09:11:58 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1650557517; 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=Co+vGxQAnvjE28xN2iS2qSyvQ7+qNi2mwvNPw4R/fZk=; b=BaypSsIzdcER11NDsYhBqeiO6h0kW1VoNrXw1mRnOiGjw3zHAcrg4LrD53LAUGez4e1C6+ jHr7Fp2APUeu3QTYZmVAhm2BRkitxZF5ud6TcRQ9fGMoTMeYRwhBPVRRhjvai6KzZ5EHKA 0dnpx2UM0sCZ5fV8DbyY1Gb8CXi6+y+WkjrVpg2SmWsgSlTdJ4j4dhFi+Z27KY9Gr3yxX/ JdOWhxwu84Nhn3EtEqrih12el44uy3fu7hybJwXJGib1INO194dEaCv8GNHE8F6759DL8t 1vDYugl5oVAakWK7O0xugEAt8j+DczJsOLJmyXjtIzkXaTQMPQnvAfFmHKoVlg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1650557517; 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=Co+vGxQAnvjE28xN2iS2qSyvQ7+qNi2mwvNPw4R/fZk=; b=fHDsl12W3lskK/WA5YoKeFFXgA5KMSxzJTX0I707X/zEBoI1l9pDlwdCg+GJuE7vBBVcKF 3GShvFgeXx5JODDA== To: Pingfan Liu , linux-kernel@vger.kernel.org Cc: Pingfan Liu , Valentin Schneider , Peter Zijlstra , Frederic Weisbecker , Baokun Li , Mark Rutland , Steven Price , "Jason A. Donenfeld" , Yuan ZhaoXiong , YueHaibing , Randy Dunlap Subject: Re: [PATCH 7/9] irq: remove needless lock in takedown_cpu() In-Reply-To: <20220420140521.45361-8-kernelfans@gmail.com> References: <20220420140521.45361-1-kernelfans@gmail.com> <20220420140521.45361-8-kernelfans@gmail.com> Date: Thu, 21 Apr 2022 18:11:56 +0200 Message-ID: <87y1zys9f7.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 20 2022 at 22:05, Pingfan Liu wrote: First of all, the subject prefix for the core interrupt subsystem is 'genirq' and the sentence after the colon starts with an uppercase letter. See: https://www.kernel.org/doc/html/latest/process/maintainer-tip.html > diff --git a/kernel/cpu.c b/kernel/cpu.c > index d0a9aa0b42e8..94a6b512c26d 100644 > --- a/kernel/cpu.c > +++ b/kernel/cpu.c > @@ -1033,18 +1033,16 @@ static int takedown_cpu(unsigned int cpu) > kthread_park(st->thread); > > /* > - * Prevent irq alloc/free while the dying cpu reorganizes the > - * interrupt affinities. > + * RCU keeps watching 'cpu' until do_idle()->rcu_report_dead(). > + * And cpu_stopper's fn is dispatched with preemption disabled. > + * So it can not occur to release a irq_desc. > */ > - irq_lock_sparse(); Not everything is about RCU here. You really need to look at all moving parts: irq_migrate_all_off_this_cpu() relies on the allocated_irqs bitmap and the sparse tree to be in consistent state, which is only guaranteed when the sparse lock is held. I'm not sure what you are trying to solve here. Not taking sparse_irq_lock here is not gaining anything. Thanks, tglx