Received: by 10.223.164.221 with SMTP id h29csp44233wrb; Fri, 3 Nov 2017 10:11:33 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QqkO/G1Ca1w4v0ctzH/TjFkLq+fbeaigsVka8+iokDsSMxMTjqTMd3kPFjEdwnUrNudDMJ X-Received: by 10.159.244.6 with SMTP id x6mr6723949plr.90.1509729093375; Fri, 03 Nov 2017 10:11:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509729093; cv=none; d=google.com; s=arc-20160816; b=alpw3J03VX/awuMmxZ4+abB3Ns4Dm05rIdpFwJXmZsR+9JK2GmcAJX/9+7Av6o0hif HrMwdvxgQ6nGIDaTXRjFtEjK7vA/B5hDi0tDesDv8pzFRdiwllJZhlzKhclHQz8Zl1Lo YlqBt9hS7uG8QmwYkm37Rt0Fwz11UfvrBVuW3i+DDja0jegfffKViJ4xJyfO4XbBs3cw FfAnR00MW5sekGVOQVsNhjGCwrK1yh2dNQZzmeVPrVLdayvKpWQFCO6ASwlwjkTsFBR8 Y2NZMCzndSSIzgIoYc0Ip6ExgTy3LzItw5Sj68fqZWZGE6XstUlY5EFwtA+m+AFifP98 ptaw== 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:arc-authentication-results; bh=KipOxFz9/mr2244gA1Lu6XBEZdQwLsxWHY6+Xr3dEhg=; b=MyjgZj6pxC1UtOmdKxE+G3OdiAOHcrdu86Q0RUQrsmyEWCPBLUFw9Lt8Y7j1F9elbS 7HavWpzjQWzAWdPeOJ54uyUPADm84svft8eNmYyGspNMnxoGlZDeXNGTCF4qdvdYU6sG ELIHJKZZi7R08ZbG3Gkg2/y1Etx+FB38s/Hl/pMreF5myA5SJxAk2QL9v59Tno2PxwUS vPlmlGpxQf+lWAGVstqTTZNAFgTXgredlF5psuRVptSKxjsM8qb2690l76IIET9avIs8 WzjNBjUAGNM6cssE9fnwaKjI2hz6heWz3CHQKuem7JNmq5+MnjAGM7slNPj2HBy+tdOt nxpA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ba12si5339978plb.95.2017.11.03.10.11.20; Fri, 03 Nov 2017 10:11:33 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756319AbdKCRIq (ORCPT + 93 others); Fri, 3 Nov 2017 13:08:46 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:56352 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756257AbdKCRFP (ORCPT ); Fri, 3 Nov 2017 13:05:15 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from cmetcalf@mellanox.com) with ESMTPS (AES256-SHA encrypted); 3 Nov 2017 19:05:09 +0200 Received: from ld-1.internal.tilera.com (ld-1.internal.tilera.com [10.15.7.41]) by mtbu-labmail01.internal.tilera.com (8.14.4/8.14.4) with ESMTP id vA3H57Am008346; Fri, 3 Nov 2017 13:05:07 -0400 Received: (from cmetcalf@localhost) by ld-1.internal.tilera.com (8.14.7/8.13.8/Submit) id vA3H57ZY010521; Fri, 3 Nov 2017 13:05:07 -0400 From: Chris Metcalf To: Steven Rostedt , Ingo Molnar , Peter Zijlstra , Andrew Morton , Rik van Riel , Tejun Heo , Frederic Weisbecker , Thomas Gleixner , "Paul E. McKenney" , Christoph Lameter , Viresh Kumar , Catalin Marinas , Will Deacon , Andy Lutomirski , linux-kernel@vger.kernel.org Cc: Chris Metcalf Subject: [PATCH v16 07/13] Add task isolation hooks to arch-independent code Date: Fri, 3 Nov 2017 13:04:46 -0400 Message-Id: <1509728692-10460-8-git-send-email-cmetcalf@mellanox.com> X-Mailer: git-send-email 2.1.2 In-Reply-To: <1509728692-10460-1-git-send-email-cmetcalf@mellanox.com> References: <1509728692-10460-1-git-send-email-cmetcalf@mellanox.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This commit adds task isolation hooks as follows: - __handle_domain_irq() generates an isolation warning for the local task - irq_work_queue_on() generates an isolation warning for the remote task being interrupted for irq_work - generic_exec_single() generates a remote isolation warning for the remote cpu being IPI'd - smp_call_function_many() generates a remote isolation warning for the set of remote cpus being IPI'd Calls to task_isolation_remote() or task_isolation_interrupt() can be placed in the platform-independent code like this when doing so results in fewer lines of code changes, as for example is true of the users of the arch_send_call_function_*() APIs. Or, they can be placed in the per-architecture code when there are many callers, as for example is true of the smp_send_reschedule() call. A further cleanup might be to create an intermediate layer, so that for example smp_send_reschedule() is a single generic function that just calls arch_smp_send_reschedule(), allowing generic code to be called every time smp_send_reschedule() is invoked. But for now, we just update either callers or callees as makes most sense. Signed-off-by: Chris Metcalf --- kernel/irq/irqdesc.c | 5 +++++ kernel/irq_work.c | 5 ++++- kernel/smp.c | 6 +++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index 82afb7ed369f..1b114c6b7ab8 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -16,6 +16,7 @@ #include #include #include +#include #include "internals.h" @@ -633,6 +634,10 @@ int __handle_domain_irq(struct irq_domain *domain, unsigned int hwirq, irq = irq_find_mapping(domain, hwirq); #endif + task_isolation_interrupt((irq == hwirq) ? + "irq %d (%s)" : "irq %d (%s hwirq %d)", + irq, domain ? domain->name : "", hwirq); + /* * Some hardware gives randomly wrong interrupts. Rather * than crashing, do something sensible. diff --git a/kernel/irq_work.c b/kernel/irq_work.c index bcf107ce0854..cde49f1f31f7 100644 --- a/kernel/irq_work.c +++ b/kernel/irq_work.c @@ -17,6 +17,7 @@ #include #include #include +#include #include @@ -75,8 +76,10 @@ bool irq_work_queue_on(struct irq_work *work, int cpu) if (!irq_work_claim(work)) return false; - if (llist_add(&work->llnode, &per_cpu(raised_list, cpu))) + if (llist_add(&work->llnode, &per_cpu(raised_list, cpu))) { + task_isolation_remote(cpu, "irq_work"); arch_send_call_function_single_ipi(cpu); + } return true; } diff --git a/kernel/smp.c b/kernel/smp.c index c94dd85c8d41..44252aa650ac 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -19,6 +19,7 @@ #include #include #include +#include #include "smpboot.h" @@ -175,8 +176,10 @@ static int generic_exec_single(int cpu, call_single_data_t *csd, * locking and barrier primitives. Generic code isn't really * equipped to do the right thing... */ - if (llist_add(&csd->llist, &per_cpu(call_single_queue, cpu))) + if (llist_add(&csd->llist, &per_cpu(call_single_queue, cpu))) { + task_isolation_remote(cpu, "IPI function"); arch_send_call_function_single_ipi(cpu); + } return 0; } @@ -458,6 +461,7 @@ void smp_call_function_many(const struct cpumask *mask, } /* Send a message to all CPUs in the map */ + task_isolation_remote_cpumask(cfd->cpumask_ipi, "IPI function"); arch_send_call_function_ipi_mask(cfd->cpumask_ipi); if (wait) { -- 2.1.2 From 1583053902693213398@xxx Fri Nov 03 14:04:08 +0000 2017 X-GM-THRID: 1583053902693213398 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread