Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1119608imu; Thu, 20 Dec 2018 10:24:22 -0800 (PST) X-Google-Smtp-Source: AFSGD/U0btrmHAIwpcMRQe/PYMDauVsA/4IfVo0K8HrMiOuLD9EPgSLoK7bm2LLJD4sYcLRkMwyl X-Received: by 2002:a63:8b41:: with SMTP id j62mr24445915pge.182.1545330262326; Thu, 20 Dec 2018 10:24:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545330262; cv=none; d=google.com; s=arc-20160816; b=U6oMU/ucd7qsrIKO/xiBUE8Pr2Aane8CgYjgWBllaFYcfKH1XnzSI8kjAj/1gBB2l3 44E4nWkPclUHuCM6dcLRoKl/LX6S8cNfVoSMC3YCk2yd9JcdLsTYspSpaL0IWFThdU3U lyu1kjoImhim0fBqKYPdBf4HBuivnjulDutRhqHkYYWnOJChYfIjcHQ/QMy2kKGcIE2X KMju9CSh+rYkuqkb3s8Y1tsFIUf2027akLVaApi6D9fk5AYKTfpoyRqoiRQtZw5LuhmF f7y8j9a7FcxexZATUz5SM4IhsnA4d6w+p7OnJ6Q+RfXxqrrBaUwwov/JPLno/jE2Trea NWPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=U5lCwU0S/XYvjUQ1zy2GnptCNF45T8w+MceIReVuXPo=; b=WlcauoQuVzg0LpaPoJX/5nVRDQMge5UOukpvjA4SffypLoFOo7TykZ2/LOU8sifWKr GeLuCVnN6V+pBQWdvhAD25GiGUugf///yo6xZpTDJAKlMXWzT9nvmdRjeiJz+O+7boPS SWOIsVJ3KWH2FixsVHmng/MPEFkkNdPZFYvJx1DzdgammQDYc01fUWmeC+kn+xDp5cs3 JLub82U6i9axwqzbIYIbFawZTjM+rUerSSWOQzncJlgkKCHsnVI1yKW49mc3rnyAQm9k lrI62HqwXwtXzPQlgkTHTWXU2OycIqmRLR+N2f7O4sQBOTXXFGxlsh1o9pFBZ7ldIpGB hi4w== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c132si18975031pga.597.2018.12.20.10.24.06; Thu, 20 Dec 2018 10:24:22 -0800 (PST) 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732153AbeLTM5d (ORCPT + 99 others); Thu, 20 Dec 2018 07:57:33 -0500 Received: from mx2.suse.de ([195.135.220.15]:33086 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729731AbeLTM5d (ORCPT ); Thu, 20 Dec 2018 07:57:33 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 2D87AACA4; Thu, 20 Dec 2018 12:57:31 +0000 (UTC) Date: Thu, 20 Dec 2018 13:57:30 +0100 From: Michal Hocko To: Vineet Gupta Cc: linux-snps-arc@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Peter Zijlstra Subject: Re: [PATCH 1/2] ARC: show_regs: avoid page allocator Message-ID: <20181220125730.GA17350@dhcp22.suse.cz> References: <1545159239-30628-1-git-send-email-vgupta@synopsys.com> <1545159239-30628-2-git-send-email-vgupta@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1545159239-30628-2-git-send-email-vgupta@synopsys.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 18-12-18 10:53:58, Vineet Gupta wrote: > Use on-stack smaller buffers instead of dynamic pages. > > The motivation for this change was to address lockdep splat when > signal handling code calls show_regs (with preemption disabled) and > ARC show_regs calls into sleepable page allocator. > > | potentially unexpected fatal signal 11. > | BUG: sleeping function called from invalid context at ../mm/page_alloc.c:4317 > | in_atomic(): 1, irqs_disabled(): 0, pid: 57, name: segv > | no locks held by segv/57. > | Preemption disabled at: > | [<8182f17e>] get_signal+0x4a6/0x7c4 > | CPU: 0 PID: 57 Comm: segv Not tainted 4.17.0+ #23 > | > | Stack Trace: > | arc_unwind_core.constprop.1+0xd0/0xf4 > | __might_sleep+0x1f6/0x234 > | __get_free_pages+0x174/0xca0 > | show_regs+0x22/0x330 > | get_signal+0x4ac/0x7c4 # print_fatal_signals() -> preempt_disable() > | do_signal+0x30/0x224 > | resume_user_mode_begin+0x90/0xd8 > > Despite this, lockdep still barfs (see next change), but this patch > still has merit as in we use smaller/localized buffers now and there's > less instructoh trace to sift thru when debugging pesky issues. But show_regs is called from contexts which might be called from deep call chains (e.g WARN). Is it safe to allocate such a large stack there? -- Michal Hocko SUSE Labs