Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1174618imu; Fri, 21 Dec 2018 14:06:23 -0800 (PST) X-Google-Smtp-Source: ALg8bN67gGb/qE7+XImoomUiFfHrbBRcQWrHm3olSigB0ZxmQtGnKZCQnvwS8qX1cOTd510nxLVE X-Received: by 2002:a17:902:96a:: with SMTP id 97mr4115621plm.45.1545429983673; Fri, 21 Dec 2018 14:06:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545429983; cv=none; d=google.com; s=arc-20160816; b=LbiqM+9gTMtRjFqU3VC03VmLmfhzTc7JyBgddNI8UNUCkW03xpVIt9wgGD+8sV8wXw V1AkbX+po29diLGuBGPENySDHLZXJe71ObfMvdtbmjw3NOc7G/tCCuWyE2s2FdCuxwhO Rm7pGsUiJ8++h37VF32aFvfivrfa2Y8e+6cZMNm1UzgTjfCRb4DR0KUobXAXtBiEdCVk WCKnvDtRAgR6ompRD718N8dVKs3liAkEJGe/dwS1GxSrf5oZxE0Jp3miZSEmJicookYk PsC0MNt//zCTLqvy/HD5bOKieYtBL3U88yP1vQYlFNzbJtpg3niFJhAhKkH6v+8QVegz HgQQ== 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=p7Gy5e8ijPL22DWf9BCxOXQCGY/B16HsQvjwL2euvME=; b=jHcFuCoqy5JpdSKFOg6u7fV4aZbeNGb2KgpCRIfTXTh4y5Tg/KaoENWgmkR4kilL1i ZZj1dakw4WxtwzS6FNjSPEWPTrcnbuoADYsZ3CLz+V4tORE4lAz8XrvdFvFTouzboxDV tPkSSLqmJUXK3gX1dLFAIrtTC/GOa+QTxoILhsp3LvgVFHNigpiKifMrHBUzqxSn7Sbx ekFHNduwEjmWNuK2Gler3KGzAAoTzlzOhBo8RcMOpvi/JUkqa5zLRUZOy2uo9F0WtBxj OmfSa4ZCzErkM3YTh4OAAU59zlcafHMmKey+hn5tTyPP06c70lI43KKweDFQMjSu2Ej5 q6QQ== 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 z10si23094795pfm.37.2018.12.21.14.05.56; Fri, 21 Dec 2018 14:06:23 -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 S2388297AbeLUNEI (ORCPT + 99 others); Fri, 21 Dec 2018 08:04:08 -0500 Received: from mx2.suse.de ([195.135.220.15]:41602 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387821AbeLUNEH (ORCPT ); Fri, 21 Dec 2018 08:04:07 -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 2AFA9AF67; Fri, 21 Dec 2018 13:04:05 +0000 (UTC) Date: Fri, 21 Dec 2018 14:04:04 +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 2/2] ARC: show_regs: fix lockdep splat for good Message-ID: <20181221130404.GF16107@dhcp22.suse.cz> References: <1545159239-30628-1-git-send-email-vgupta@synopsys.com> <1545159239-30628-3-git-send-email-vgupta@synopsys.com> <20181220130450.GB17350@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Thu 20-12-18 18:45:48, Vineet Gupta wrote: > On 12/20/18 5:04 AM, Michal Hocko wrote: > > On Tue 18-12-18 10:53:59, Vineet Gupta wrote: > >> 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()") > > The commit you are referring to here sounds dubious in itself. > > Indeed that was my thought as well, but it did introduce the preemption disabling > logic aroung core calling show_regs() ! > > > We do not > > want to stick a preempt_disable just to silence a warning. > > I presume you are referring to original commit, not my anti-change in ARC code, > which is actually re-enabling it. Yes, but you are building on a broken concept I believe. What implications does re-enabling really have? Now you could reschedule and you can move to another CPU. Is this really safe? I believe that yes because the preemption disabling is simply bogus. Which doesn't sound like a proper justification, does it? > > show_regs is > > called from preemptible context at several places (e.g. __warn). > > Right, but do we have other reports which show this, perhaps not too many distros > have CONFIG__PREEMPT enabled ? I do not follow. If there is some path to require show_regs to run with preemption disabled while others don't then something is clearly wrong. > > Maybe > > this was not the case in 2009 when the change was introduced but this > > seems like a relict from the past. So can we fix the actual problem > > rather than build on top of it instead? > > The best/correct fix is to remove the preempt diabling in core code, but that > affects every arch out there and will likely trip dormant land mines, needed > localized fixes like I'm dealing with now. Yes, the fix might be more involved but I would much rather prefer a correct code which builds on solid assumptions. -- Michal Hocko SUSE Labs