Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1058459ybz; Thu, 16 Apr 2020 01:58:38 -0700 (PDT) X-Google-Smtp-Source: APiQypItTE7mT6/Wi1ehUj1vOy7xDVDrA2aZSIEJXBITxDxvaM/tQnaNcLYFNqUCcF48+9kT15IO X-Received: by 2002:a05:6402:4ce:: with SMTP id n14mr15560668edw.32.1587027518186; Thu, 16 Apr 2020 01:58:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587027518; cv=none; d=google.com; s=arc-20160816; b=J421wvnh40HS7IJ8xqXR1IvF53+VWbbgaPqUfszKLyAe8i3Cu8RbnN18X1itmQMqIv m4aAv72otedl4q2y0hXnV2a6+XfRcR7lsBOdPm7ws7s+VumN37xa9yXTrbSFWH7RVq1M xPFSpzTplA+q05VpGOZzszckqQUrXxh3OwPKEwhdVVbVhhz/jZO6CFfdSOF+FMjVm68R bTGtoq6RSM2xgOMWgKIOkKaF52/InXsex9X2bV7tFxWHeKmzel/ALPGRN8kjVur43Dqd 9D2LUI1EoGxDe+GTBHpGnfrmZhryJJrJTqBTf/qQ03aR8pb02R9sYHbs152y2Zvtgq6k gddA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=9+zb5lOcLNsdGEIiZVneJyZa5T7eObObpHMI11tV4t8=; b=WWOrPOsA0FfKzSeTAgfOQTTVNAlvHCmaPMwLSLYRv1IvHEU5ccT3k63g3Di4xaima/ rhAO/ISja44AgaflX0rejVOtnLh3eTdVnk8TWmIqBbOIz7/C/ua/MFE7Zr6BTSlFpgbH XiZ3F0dG7TumO0DnXTjhILHaU44iyGvF91FI9jkRHNHZJkEVAeUSh7qV53hMCGHwPCRI DpGDRIv4t63V2IzBoMkw5HZWqUuQSOy3BvZjFwwxIVykUrIEHgaXcp5gmB/lL5i0Oy03 yNzCjRLgwwRzPdlKavdOIye5WYA1qvam9lJZZDsLfg2VQAjh2wQEHvERZ0iX19OqFa7F vu2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=NKOHMxJC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u12si5140231edb.262.2020.04.16.01.58.15; Thu, 16 Apr 2020 01:58:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=NKOHMxJC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2503050AbgDPI4T (ORCPT + 99 others); Thu, 16 Apr 2020 04:56:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2502961AbgDPIx3 (ORCPT ); Thu, 16 Apr 2020 04:53:29 -0400 Received: from merlin.infradead.org (unknown [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C0EDC061A0C for ; Thu, 16 Apr 2020 01:53:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=9+zb5lOcLNsdGEIiZVneJyZa5T7eObObpHMI11tV4t8=; b=NKOHMxJCg9d1kbkGnKRxNQtJGz aOxmEsHEBe0neyXzFYrXKEr5VS4EW70w98HmVO0/Z4gEFgCpJumbE2fNZHhseyBGBaKM/tBl/0WZl 2n3Gpa9N6mEe7hImlNeOABNoy7DfL7O/gi7ETvOe6hqSwdah15x2IhlpFH4J9u0J+T4ZkQoaEfjUb /CeKnK6aa0PAad8y7vXP/t3BJUF3T06VxTCq/SmxUu+X/FA0hqolzQrqpzaEnsorj6K4n6YRR+e5r AOqsy+5w9ZnEWNTlaqLeHtKVK8qTMNcvXZEG5rSvn77lzpudoOoSFR7ubeHPqzSuyKJaQbec1oDhR EVkjogBw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jP0GS-0001bN-PE; Thu, 16 Apr 2020 08:52:52 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id E52E83006E0; Thu, 16 Apr 2020 10:52:49 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id CF9762B0DB555; Thu, 16 Apr 2020 10:52:49 +0200 (CEST) Date: Thu, 16 Apr 2020 10:52:49 +0200 From: Peter Zijlstra To: Jann Horn Cc: Thomas Gleixner , Ingo Molnar , Andrew Morton , Frederic Weisbecker , Steven Rostedt , kernel list Subject: Re: [PATCH v2] exit: Move preemption fixup up, move blocking operations down Message-ID: <20200416085249.GL20730@hirez.programming.kicks-ass.net> References: <20200305220657.46800-1-jannh@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 24, 2020 at 10:30:02AM +0100, Jann Horn wrote: > On Thu, Mar 5, 2020 at 11:07 PM Jann Horn wrote: > > With CONFIG_DEBUG_ATOMIC_SLEEP=y and CONFIG_CGROUPS=y, kernel oopses in > > non-preemptible context look untidy; after the main oops, the kernel prints > > a "sleeping function called from invalid context" report because > > exit_signals() -> cgroup_threadgroup_change_begin() -> percpu_down_read() > > can sleep, and that happens before the preempt_count_set(PREEMPT_ENABLED) > > fixup. > > > > It looks like the same thing applies to profile_task_exit() and > > kcov_task_exit(). > > > > Fix it by moving the preemption fixup up and the calls to > > profile_task_exit() and kcov_task_exit() down. > > > > Fixes: 1dc0fffc48af ("sched/core: Robustify preemption leak checks") > > Signed-off-by: Jann Horn > > --- > > As so often, I have no idea which tree this should go through. tip? mm? > > Do the tip folks want to take this, since it's vaguely locking-related > and the fixed commit also came that way? Or should it go through > akpm's tree? I've picked it up, as it seems to be languishing. Thanks!