From patchwork Mon Mar 13 19:43:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prasad Sodagudi X-Patchwork-Id: 9621941 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A3F9A60492 for ; Mon, 13 Mar 2017 19:44:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9034828179 for ; Mon, 13 Mar 2017 19:44:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8469E283A6; Mon, 13 Mar 2017 19:44:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 18C1C28179 for ; Mon, 13 Mar 2017 19:44:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:Subject:To:From: Date:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DjGDEKtx5f8GaB2F79+oRiCyR9WmCCtLr9d7BIAWYdc=; b=QzQqLnfL0XHyxe7PgQL25izzo MrVeg5SFTATojoZ/CD2/jKvBtLGKdrjydSGVWdYxjaJKuTpdikRn0Ui7RXvXh/wtrneOrbWymtnuT 9H5rE6Y1hewKk6OMJw/qiUzbTLoYRtZMMezgJv0dpXMJyvO1IqNhhCLLLzLL86yGdmffJlrBNgpjv UpWgEawNRt4lwowGhpvJsRMi3zA3V9uSm3hRmbQ0YzU6yvOBwS9bZLI7VNDyUO3Skg6Ak1lA+KtWQ 8mS8ThBowprfUlChOxAKwnFrrjjpLHq7gLotgwNXyU6DmYtfT8CGFbw3ngdXIfoH1vyD2boAAa/Hr pRDIVPUdQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cnVtD-0004H6-Bk; Mon, 13 Mar 2017 19:44:19 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cnVt9-0004Eo-3z for linux-arm-kernel@lists.infradead.org; Mon, 13 Mar 2017 19:44:16 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 174706095E; Mon, 13 Mar 2017 19:43:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1489434234; bh=wMKg2U/FaBrmuAryNtmJC0W1m7T5w8g0EeoESXbdPWk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=UYxi3OZXxtCrW2lQN60knDhjrBdAvMwc+cI1i/MoEYaqdrLKqoc59r/mIgfqV/M4F XzyLil+qoLY/8YFqGsVJ4gIfX69LOgRyKJgSr3DiLUEFlur/6NReszuTU0DU1MKJoz 54+4/O/dFsvObOOPFJo0NGpWg+V9GCgXBxmQIUAA= Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 87EA66095E; Mon, 13 Mar 2017 19:43:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1489434233; bh=wMKg2U/FaBrmuAryNtmJC0W1m7T5w8g0EeoESXbdPWk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=COG8krlAlPpjKX2xewIQLHdK8W4FQEfehjFipiQryjWYkdq0lkxNFqMuK1UkyCMvy f3++K0667fJxB9Yj32cAyOmppduY4LU1SkPdeUaLffys5nci2yxTz6BnKHLPwV0v2j TBUJGaekFMidqXTz+mor6oUSUfvGSMWREKnu3dhw= MIME-Version: 1.0 Date: Mon, 13 Mar 2017 12:43:53 -0700 From: Sodagudi Prasad To: Thomas Gleixner Subject: Re: Schedule affinity_notify work while migrating IRQs during hot plug In-Reply-To: References: <05102c455476941d37904f8c6f387452@codeaurora.org> Message-ID: <36fe90bcca0a9c6283c4012412ed2924@codeaurora.org> X-Sender: psodagud@codeaurora.org User-Agent: Roundcube Webmail/1.2.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170313_124415_252233_25EB2303 X-CRM114-Status: GOOD ( 13.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: will.deacon@arm.com, james.morse@arm.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On 2017-02-27 09:21, Thomas Gleixner wrote: > On Mon, 27 Feb 2017, Sodagudi Prasad wrote: >> So I am thinking that, adding following sched_work() would notify >> clients. > > And break the world and some more. > >> diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c >> index 6b66959..5e4766b 100644 >> --- a/kernel/irq/manage.c >> +++ b/kernel/irq/manage.c >> @@ -207,6 +207,7 @@ int irq_do_set_affinity(struct irq_data *data, >> const >> struct cpumask *mask, >> case IRQ_SET_MASK_OK_DONE: >> cpumask_copy(desc->irq_common_data.affinity, mask); >> case IRQ_SET_MASK_OK_NOCOPY: >> + schedule_work(&desc->affinity_notify->work); >> irq_set_thread_affinity(desc); >> ret = 0; > > You cannot do that unconditionally and just slap that schedule_work() > call > into the code. Aside of that schedule_work() would be invoked twice for > all > calls which come via irq_set_affinity_locked() .... Hi Tglx, Yes. I agree with you, schedule_work() gets invoked twice with previous change. How about calling irq_set_notify_locked() instead of irq_do_set_notify()? -Thanks, Prasad > > Thanks, > > tglx diff --git a/kernel/irq/cpuhotplug.c b/kernel/irq/cpuhotplug.c index 011f8c4..e8ce0db 100644 --- a/kernel/irq/cpuhotplug.c +++ b/kernel/irq/cpuhotplug.c @@ -18,8 +18,8 @@ static bool migrate_one_irq(struct irq_desc *desc) { struct irq_data *d = irq_desc_get_irq_data(desc); const struct cpumask *affinity = d->common->affinity; - struct irq_chip *c; bool ret = false; + int r; /* * If this is a per-CPU interrupt, or the affinity does not @@ -34,15 +34,10 @@ static bool migrate_one_irq(struct irq_desc *desc) ret = true; } - c = irq_data_get_irq_chip(d); - if (!c->irq_set_affinity) { - pr_debug("IRQ%u: unable to set affinity\n", d->irq); - } else { - int r = irq_do_set_affinity(d, affinity, false); - if (r) - pr_warn_ratelimited("IRQ%u: set affinity failed(%d).\n", + r = irq_set_affinity_locked(d, affinity, false); + if (r) + pr_warn_ratelimited("IRQ%u: set affinity failed(%d).\n", d->irq, r); - } return ret;