From patchwork Tue Dec 18 18:53:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vineet Gupta X-Patchwork-Id: 10736217 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 31048924 for ; Tue, 18 Dec 2018 18:54:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2231429589 for ; Tue, 18 Dec 2018 18:54:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 16272295B7; Tue, 18 Dec 2018 18:54:22 +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=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A952529589 for ; Tue, 18 Dec 2018 18:54:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 339718E000A; Tue, 18 Dec 2018 13:54:19 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 2C2EF8E0001; Tue, 18 Dec 2018 13:54:19 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 18EF38E000A; Tue, 18 Dec 2018 13:54:19 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by kanga.kvack.org (Postfix) with ESMTP id C04918E0001 for ; Tue, 18 Dec 2018 13:54:18 -0500 (EST) Received: by mail-pl1-f198.google.com with SMTP id b24so12537870pls.11 for ; Tue, 18 Dec 2018 10:54:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version; bh=6R41jBjC0odWkKxchuCxIvvNe1FEJ8P9XFqNcU5syJo=; b=The8geH4uVLK7yU5rmcN92yoig7CiYNCCmX4p/SMu+1jJS6ibcUaHMs4uj8klji7zB qncrt1FizZd/6C6Jw/PnqLVxkFHw8QJkpJbV3KUAQqEwxijcCc3MMF5bUVe287ms+VD7 4GysEEbxwLMqchW1aNnyz3izurSgT2yL6/zCe6wHnq/Kva1LjWAsDOfmURRhzhGYFaAG GvAq5Umhb5EICJBAG5BTSuKItnSYL+nt9NjJE+pKfMzPWYqa4bt/M6CkOFjeEUlA2B8n CobXO/pLqQ/gtbUvfbATiC1giUZWehwN+Hy51uq2LxCE3c9gRmTO6ZkhdZUlC55qRFgt 6twg== X-Gm-Message-State: AA+aEWaIhXh2Hc8ACo7MWfarsb0vArycXcwIw3yh1rSyXewwgegl1t3+ kfYXOPfLH9tH1RdpJNQwgNG9b7uDH7kK6cdhKqUEBzXF2UJRN+RFFZHWVjsFKxFY2EjcZhTGtY3 wCY9kE1f+HN7qaWrjWC9hOZM7pGktEsTjIq1Zc4CFPnS17nt4it4xJncHTevnQRGT6g== X-Received: by 2002:a17:902:622:: with SMTP id 31mr17151615plg.171.1545159258402; Tue, 18 Dec 2018 10:54:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/UQvblpKHVrwcNuYpQu2bFwCzmZWIA9Jdfz1hdyToRR+BvBzfAJ0nfsIadE4Kpu/IjPDAly X-Received: by 2002:a17:902:622:: with SMTP id 31mr17151584plg.171.1545159257717; Tue, 18 Dec 2018 10:54:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545159257; cv=none; d=google.com; s=arc-20160816; b=cKWjMSbadZ1ymu60hIl7Qzc8m4ka0T+VNl0UjkBAyYOmE7wIRhLncAy88MqgDkYcmO vD/eaxAT9tTMKtUDpq9zUwBq9sBp00KykYYwkTvjivU7EM8iZd8eLilNSwDBRKMkaNfM VDGfU/oZoKzM/aox/NBofubLr46eUxGiKeuJ9oMLH3ly12AUKJeCR1SJqve1URmFiqNg N9Jp8osNv4bUiIH3vt1Ayi6nCbtIsa6ZmuIWf0hqRtCqV+fmn49hdPDuq4L2p5tpXht5 U80IkH69yZmvIOH5bSLoMwRc5NoKi7hm8PDYGV7WwK3DI1NpTFomkEJCjNaZ9hcwlFhJ ap7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6R41jBjC0odWkKxchuCxIvvNe1FEJ8P9XFqNcU5syJo=; b=VQzldJo+zEaQaG6GzEoY9tnjL3WDGL4x7ivduvNqPiVvWr2eh1NfbF+rmvw7GRhEdN kpGt6OZLk0JSN+Eo1VCybX2wpDJJeE/mmFoagjHRYvBDKWTGeBoXeE2gsfe+U6QkU5Ac XpE6tAqVlim5b95++uynOMUY47aJXthvYEMAHYLhurvrbnvhz4N0yompFFZd2Si7ay6d RDWqa8nqCkHQLafta5q7ZgxpWunROGOLZ+xO97TUVAE675FBQ1MQjDCYbq006kHYS1rD G5+99jcmx8VeR5xCXrdfzEjNQ53Z2QSMIHkETzQ2KDMRVvFFhwyIepkduOsaC8ljTICi ZKZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=AbtvNVXP; spf=pass (google.com: domain of vineet.gupta1@synopsys.com designates 198.182.47.9 as permitted sender) smtp.mailfrom=vineet.gupta1@synopsys.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: from smtprelay.synopsys.com (us01smtprelay-2.synopsys.com. [198.182.47.9]) by mx.google.com with ESMTPS id t3si10655638pgg.403.2018.12.18.10.54.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Dec 2018 10:54:17 -0800 (PST) Received-SPF: pass (google.com: domain of vineet.gupta1@synopsys.com designates 198.182.47.9 as permitted sender) client-ip=198.182.47.9; Authentication-Results: mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=AbtvNVXP; spf=pass (google.com: domain of vineet.gupta1@synopsys.com designates 198.182.47.9 as permitted sender) smtp.mailfrom=vineet.gupta1@synopsys.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id 3CD8924E2808; Tue, 18 Dec 2018 10:54:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1545159257; bh=9sw3xXmZzMD2r1pq0e6toINGoyuET/YizCJnsRVXBDc=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=AbtvNVXP9+o791uc/g/C/uYcKKKenE1jeDHA/Q9Jf1C9W059a2cTbOfff22ukJdMr 37EO4b0elciThdTl4xZg+NFwe51fWOFFyZ7WMlh83E8wX/ajbZu6ekjH1QHNc4gdXq XYQ0NOaNLUWq7rljmUE86+TLr2VoqtztIvThK/0YN03P3+WeqMaLn2Pq/MrJCwIvjA kahcV6OU3NzQ++DI/nKzaL4my7ZXf48Q86ODGw1bmr1unNQpMEGln1Y0dR7HS53hi6 iJZEAi7dcQumqCOmk+Wr8RHk1AEdD26X8jisV28B/OV+Ujr1pkMH98dST+aIkrDINt yRRSc0w+mHCJA== Received: from us01wehtc1.internal.synopsys.com (us01wehtc1-vip.internal.synopsys.com [10.12.239.236]) by mailhost.synopsys.com (Postfix) with ESMTP id 2460E5422; Tue, 18 Dec 2018 10:54:17 -0800 (PST) Received: from IN01WEHTCA.internal.synopsys.com (10.144.199.104) by us01wehtc1.internal.synopsys.com (10.12.239.231) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 18 Dec 2018 10:54:17 -0800 Received: from IN01WEHTCB.internal.synopsys.com (10.144.199.105) by IN01WEHTCA.internal.synopsys.com (10.144.199.103) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 19 Dec 2018 00:24:14 +0530 Received: from vineetg-Latitude-E7450.internal.synopsys.com (10.10.161.70) by IN01WEHTCB.internal.synopsys.com (10.144.199.243) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 19 Dec 2018 00:24:13 +0530 From: Vineet Gupta To: CC: , , , Peter Zijlstra , "Vineet Gupta" Subject: [PATCH 2/2] ARC: show_regs: fix lockdep splat for good Date: Tue, 18 Dec 2018 10:53:59 -0800 Message-ID: <1545159239-30628-3-git-send-email-vgupta@synopsys.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1545159239-30628-1-git-send-email-vgupta@synopsys.com> References: <1545159239-30628-1-git-send-email-vgupta@synopsys.com> MIME-Version: 1.0 X-Originating-IP: [10.10.161.70] X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP signal handling core calls ARCH show_regs() with preemption disabled which causes __might_sleep functions such as mmput leading to lockdep splat. Workaround by re-enabling preemption temporarily. This may not be as bad as it sounds since the preemption disabling itself was introduced for a supressing smp_processor_id() warning in x86 code by commit 3a9f84d354ce ("signals, debug: fix BUG: using smp_processor_id() in preemptible code in print_fatal_signal()") Signed-off-by: Vineet Gupta --- arch/arc/kernel/troubleshoot.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arc/kernel/troubleshoot.c b/arch/arc/kernel/troubleshoot.c index 2885bec71fb8..c650d3de13e1 100644 --- a/arch/arc/kernel/troubleshoot.c +++ b/arch/arc/kernel/troubleshoot.c @@ -177,6 +177,12 @@ void show_regs(struct pt_regs *regs) struct task_struct *tsk = current; struct callee_regs *cregs; + /* + * generic code calls us with preemption disabled, but some calls + * here could sleep, so re-enable to avoid lockdep splat + */ + preempt_enable(); + print_task_path_n_nm(tsk); show_regs_print_info(KERN_INFO); @@ -219,6 +225,8 @@ void show_regs(struct pt_regs *regs) cregs = (struct callee_regs *)current->thread.callee_reg; if (cregs) show_callee_regs(cregs); + + preempt_disable(); } void show_kernel_fault_diag(const char *str, struct pt_regs *regs,