Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3572328imu; Mon, 7 Jan 2019 05:54:21 -0800 (PST) X-Google-Smtp-Source: AFSGD/UGtmaS0alXh5E4Io+JHNADi27+1yB3OXriiYLFWvnNl7GqVUvSdbbkibivGfCX6yZOxYKi X-Received: by 2002:a62:9683:: with SMTP id s3mr62745155pfk.60.1546869261468; Mon, 07 Jan 2019 05:54:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546869261; cv=none; d=google.com; s=arc-20160816; b=FNtCsNfbFM384Ga231fVLRGfr+rqxcfaeoMHVNZFPdUbfm30k7XIr9hOhfkqxKG6qH QjmA/zFINf2qhM+nQPOONfDaoDQ1ag2XfFE5o8qozIIZdQuPFDWU9jAA2cuaDzyjNWV5 w1hvNhWgEFAiMCKQLJEgXkB+55orOmXZmSp2D7ZLShBuuOHnDy9Im4DjdkPMhsC3TTZP Z+DzUTMSXZrnLO0ZSFepmoQnN79KMhl8O88xMcy0lpNhNgMVlKV6/ml4LK03D7MteRfa e1xkC4pUblk3LKDndKlWZdufjspiY18kCMqiZyKgqRth4Cd5W2FpBBy0kbJeXjb7thAO ntWg== 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:dkim-signature; bh=cuikh8AR77ogAraE1WdLIkp6L7qIncpOsu0K38KKF84=; b=oUUtx4HOgJno+VKp0kXrV4pzMLEVFgkI+RnHYaZ9IDjSwAF5rl5spHE9hYAqqc61uR m7LvC8CeQHAZYmKbZ1wfmWzcTXFFsqFuM8NQTYb5AmRllup3OjOsppChX+LZbsbjCY4V BMiw2gMDt7P6ymcmuyg3DGh16h4CWWVGO56h58DZe6GjlHXfdhSXokmoe89ggyBEE4Zm 2ME1D33pV7Eah1O1CJExRhXmHUbPDH9Fl9eryGeaPrjTVYz7cfmyRKYK5olSUZprJP1p c1H9Ynl/Sq0Deq3bGLzU3wVej7PtlYbK6gBQMM4TeE315uoVoVcUKg55bIDZleARz+Vm FqjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=yr48kkru; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o68si6177721pfo.140.2019.01.07.05.54.04; Mon, 07 Jan 2019 05:54:21 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=yr48kkru; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728642AbfAGNwV (ORCPT + 99 others); Mon, 7 Jan 2019 08:52:21 -0500 Received: from merlin.infradead.org ([205.233.59.134]:37880 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728196AbfAGNwV (ORCPT ); Mon, 7 Jan 2019 08:52:21 -0500 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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=cuikh8AR77ogAraE1WdLIkp6L7qIncpOsu0K38KKF84=; b=yr48kkru1MTWM40RKlC+s/78Y bUdIMguAtN2t0zplnmU2tHyh4X+hmHKiCpaywJJxeMMtrZcCj+sti/wXO+g7jDjy2jXupbvKGDZyE UjbYeMjT+1Drjg4MAYHFkP8kLxEhIFhsnTG5RfxIYATLRBaaZtlM2ZpZTmEKQPu8KUthmDb8dDVIy Xuv6F6EVCHVG/hFRAEG84HallGUbZEVYHOC2zGQHijKOnF7tvveHK/Tp4pfm+Nil7KFKKR6P9Nqg2 JDN+iXk4dl+inK9EM7aiI8nrMxl0JIWNgLL053kUk5YIjXy+VGu5U0UhnYMtIMtgnBAzW0duXvs1e FH3M0R5/g==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1ggVKD-0005RN-9z; Mon, 07 Jan 2019 13:52:17 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C4ADA236FC599; Mon, 7 Jan 2019 14:52:15 +0100 (CET) Date: Mon, 7 Jan 2019 14:52:15 +0100 From: Peter Zijlstra To: Qian Cai Cc: Ingo Molnar , linux kernel , Oleg Nesterov , gkohli@codeaurora.org Subject: Re: kernel BUG at kernel/sched/core.c:3490! Message-ID: <20190107135215.GG14122@hirez.programming.kicks-ass.net> References: 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 Tue, Jan 01, 2019 at 12:44:35AM -0500, Qian Cai wrote: > Running some mmap() workloads to put the system on low memory situation with > swapping and OOM, and then it trigger this BUG(), > > void __noreturn do_task_dead(void) > { > /* Causes final put_task_struct in finish_task_switch(): */ > set_special_state(TASK_DEAD); > > /* Tell freezer to ignore us: */ > current->flags |= PF_NOFREEZE; > > __schedule(false); > BUG(); > > /* Avoid "noreturn function does return" - but don't continue if BUG() > is a NOP: */ > for (;;) > cpu_relax(); > } This would mean that we somehow loose the TASK_DEAD state before hitting schedule(), but that is something that should be avoided by set_special_state(), which is supposed to serialize against concurrent wake-ups. Also see commit: b5bf9a90bbeb ("sched/core: Introduce set_special_state()") How readily does this reproduce?