Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4640589ybb; Tue, 24 Mar 2020 02:31:05 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvv0wprTF2QljmGuKmFHV5IS5Z+pfk8tMVyUm4GuZjt/MknovEQ2eo0sGVet/dnM9sr4lwI X-Received: by 2002:aca:cf48:: with SMTP id f69mr2513395oig.122.1585042265591; Tue, 24 Mar 2020 02:31:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585042265; cv=none; d=google.com; s=arc-20160816; b=LyykCOMlNGZzMMD77G2qGpfcUHwJJzHDcF38pTj5Mp+ygGaFB2QVYSQgWmxk0zG+sD R/5gn7HbLb2konjkVfite5gc/G960GSKwxpCLxdUJ7zd4vzQ7uqeFejYjO+2A3LVTiLd X5ta0CstRZeX1RgyRO4gGBQLB4TpF0QbsT4uhfFIHAHusRpVYf7oS1Twwh65/lekkK2c bxstD746nXr4ImYpRzjZ4SKs7PD8O3nl5HPOhsg7gDdK3wZny9N2MfcVoYb34XFrxPmb S/iR0A3AoA0mAunYdYcTtk7al1YAHRGq0BMoaeVyTho4kBoElYEFtxvfpiG+djSW6FAt vmzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=A/0KAii201T0LPKgB9S97/7pdilYmedqXQq8pqjza4Q=; b=zLQGUd+Lmqk9yGpgHCzC6O/0euUMi/7IzBF/YRigY3yhXPgtpy4tc65Rxy+OWaozxW pgbDhqOEA3cODwZR/eIZvtpDQf5DYDr8odhI75qqcuL6eeF/rxx3eXwpwcSvKAshZq21 lB0NVOaSnvQr8mMOUAkIZKVj8fJTuT0WQvch+TeiT9wPtx1VSav3oToCqjOkAd4Oorcf GFaRLbpm/Qx15BRD6g5eGj6lsZucjwTXqUZjfT6zs6V2+2GXdvQ6Y7QDkcOeDdXIUblq mv/IQc25fGAlYkb0VOdjUskqhO2dbz3haVxCvRMVxsf3yw6RCfWVjBHXWeg8/p7671CJ rkDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=tsydS4fN; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t2si8750414otb.284.2020.03.24.02.30.51; Tue, 24 Mar 2020 02:31:05 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=tsydS4fN; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727129AbgCXJab (ORCPT + 99 others); Tue, 24 Mar 2020 05:30:31 -0400 Received: from mail-oi1-f194.google.com ([209.85.167.194]:43919 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726944AbgCXJab (ORCPT ); Tue, 24 Mar 2020 05:30:31 -0400 Received: by mail-oi1-f194.google.com with SMTP id p125so17811926oif.10 for ; Tue, 24 Mar 2020 02:30:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=A/0KAii201T0LPKgB9S97/7pdilYmedqXQq8pqjza4Q=; b=tsydS4fNF/NawIXvCg86I+MG1NzHQ1Sa5aWtwNl2oRuLaKpZpgjMBqEGWsOebtxBGu HgTGGtTqAVow1EuCXBYEsugpLRv4MeF4EcqFZm8G9TvZ5vYFPe0+Q/k/Oyvk3yMKufao zNqNtY+HOKv6RHNb6OJxhEtNRs4dQbGREfJb2j68SkGuy3KP2QG0QCpBWwSRcUGrotxp JMuXFWaKR38pz4ZRwKJmyCekeU11PFwWMjcSDbgkJfIBbE56TkKtKc8JTei+oSNq/bZW vFHB9Kbtjx8hFcxsCYtpNfFXCsmy4CAlsmR12tOBoKVkemjrqRiaZyTQV6sNyvQjUb3R pAwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=A/0KAii201T0LPKgB9S97/7pdilYmedqXQq8pqjza4Q=; b=iOg2aGYdn/JBc27WFkcl7SfX+XsR0C+h6xnR7BaF8nSeEWWGZB05a9kQfrtjPVWiIB 7duPDwoQe+V0euOjAMEcQ3mYL76tYW7k16jEN3CmNcUOE5Aabf90yzpincDb0jSbuGu7 K4NAo1s9XUC6zmvkGf2qjXOvu+qhop+gUU3kcttDwQ/k0FMjdM8wU2NvVIvsJsL+DH5q kQucPC1S71j+RZD8zcFNYMyV67UHRpDPBLCrMsdXiS7jgkhsB+523QuRilxUge5ki8kj rlUhOmVW2s051ydGTJc3FCJe5PzffASqmuDzmW15AU49KyGwt1A+nA4lNrytqhgz0QMt EbNg== X-Gm-Message-State: ANhLgQ3Oo09muaoDBBecuMmdPSQHlBprODdFUROHHwifwqJzthW6qLP3 uVCuwW9Ti9CviNWPf4+1JToWgYUvWPoUAegBmiMNNQ== X-Received: by 2002:a05:6808:8db:: with SMTP id k27mr2729131oij.175.1585042228749; Tue, 24 Mar 2020 02:30:28 -0700 (PDT) MIME-Version: 1.0 References: <20200305220657.46800-1-jannh@google.com> In-Reply-To: <20200305220657.46800-1-jannh@google.com> From: Jann Horn Date: Tue, 24 Mar 2020 10:30:02 +0100 Message-ID: Subject: Re: [PATCH v2] exit: Move preemption fixup up, move blocking operations down To: Peter Zijlstra , Thomas Gleixner , Ingo Molnar Cc: Andrew Morton , Frederic Weisbecker , Steven Rostedt , kernel list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?