Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4544907imm; Tue, 7 Aug 2018 03:27:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcSyuNzy8sV3WWnyDjxFTxW4VWqBz0BfsK+xIj/j52VFmlcfDxVc5fBYoVSGqNAHSU4L0+d X-Received: by 2002:a63:1902:: with SMTP id z2-v6mr17754278pgl.86.1533637660435; Tue, 07 Aug 2018 03:27:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533637660; cv=none; d=google.com; s=arc-20160816; b=HlMeXUMFtHwcwQVkfz77kPwLj3m/eejgLG5jLxLW+UgzIBIzWWDViuyLayQ0l12N1Z z+Fy1VIK8U0b/F1gwBit/lbancr1NBbaN5KijH1JE8zVgDE1LN8V5+OWHx+SanIwhtR9 RpCd84aV/8ef9xLgOIivAwsino6SHyeigW7k/5OcF7b8cukI3V4pIAoZcCESpW1GqUtN zE6mkdZDcBBrIE2OKL3bBXgkOKiPtXx2nc/3ZgvIrUS1WwbsABkMpQ6fEqwGJFCD0UJ7 +JGMnfQWUgSuBkPQkATAziNIc5bhWv0SG4rBoISDkaMdYJ68F+Taj1MQDd68DVRrS73j I3KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:arc-authentication-results; bh=B9NBa5LECL/x/RAS/lwNpAonsGpB90ZP3hDEZAThZhI=; b=Ve0/ksi2vM0vO7gy2iv6pyluuBE+PGsaECI+Q2frwkKDJ5PngLOGuaEV5P4HOomMGt BINQLu4sTH8/uzKVA6ZCr+75YN0Fqb/Sc4Omn9P+iPho7V6PlaoMGrwozMQMvwcbqrpS s97Fr3vL17jbw6Pr2ZLPDS3dDApSSew3izo8fvzJmtiivQhoza8rpYL9yMHtXaPh2EVR ZfrPrI7UpYw/xg68lCrQSDxpbowuthiG/IBvxddZDo3rmfc7q0lL7bPMNjnoww4W1mmf FVosT/PVNkyGwK47hzU2KClMbwJdsTuRs5MJU67ox9muNpaQiE5PMtjdCopG8V1S2ANq 50cQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 26-v6si1128206pgo.169.2018.08.07.03.27.26; Tue, 07 Aug 2018 03:27:40 -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; 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 S2388675AbeHGMcs (ORCPT + 99 others); Tue, 7 Aug 2018 08:32:48 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:19911 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388457AbeHGMcs (ORCPT ); Tue, 7 Aug 2018 08:32:48 -0400 Received: from fsav105.sakura.ne.jp (fsav105.sakura.ne.jp [27.133.134.232]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id w77AJA15065140; Tue, 7 Aug 2018 19:19:10 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav105.sakura.ne.jp (F-Secure/fsigk_smtp/530/fsav105.sakura.ne.jp); Tue, 07 Aug 2018 19:19:10 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/530/fsav105.sakura.ne.jp) Received: from [192.168.1.8] (softbank126074194044.bbtec.net [126.74.194.44]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id w77AJAna065134 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 7 Aug 2018 19:19:10 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: WARNING in try_charge From: Tetsuo Handa To: Michal Hocko Cc: syzbot , cgroups@vger.kernel.org, dvyukov@google.com, hannes@cmpxchg.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, syzkaller-bugs@googlegroups.com, vdavydov.dev@gmail.com References: <0000000000006350880572c61e62@google.com> <20180806174410.GB10003@dhcp22.suse.cz> <20180806175627.GC10003@dhcp22.suse.cz> <078bde8d-b1b5-f5ad-ed23-0cd94b579f9e@i-love.sakura.ne.jp> <20180806203437.GK10003@dhcp22.suse.cz> <3cf8f630-73b7-20d4-8ad1-bb1c657ee30d@i-love.sakura.ne.jp> <20180806205519.GO10003@dhcp22.suse.cz> <9c03213f-c099-378b-e9fd-ed6f2a2afdc3@i-love.sakura.ne.jp> Message-ID: Date: Tue, 7 Aug 2018 19:19:08 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <9c03213f-c099-378b-e9fd-ed6f2a2afdc3@i-love.sakura.ne.jp> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/08/07 6:50, Tetsuo Handa wrote: > list_for_each_entry_safe(p, tmp, &oom_victim_list, oom_victim_list) { > struct mm_struct *mm = p->signal->oom_mm; > > if (oom_unkillable_task(p, oc->memcg, oc->nodemask)) > continue; > ret = true; > + /* > + * Since memcg OOM allows forced charge, we can safely wait > + * until __mmput() completes. > + */ > + if (is_memcg_oom(oc)) > + return true; Oops. If this OOM victim was blocked on some lock which current thread is holding, waiting forever unconditionally is not safe. > #ifdef CONFIG_MMU > /* > * Since the OOM reaper exists, we can safely wait until > * MMF_OOM_SKIP is set. > */ > if (!test_bit(MMF_OOM_SKIP, &mm->flags)) { > if (!oom_reap_target) { > get_task_struct(p); > oom_reap_target = p; > trace_wake_reaper(p->pid); > wake_up(&oom_reaper_wait); > } > #endif > continue; > } > #endif > /* We can wait as long as OOM score is decreasing over time. */ > if (!victim_mm_stalling(p, mm)) > continue; > gaveup = true; > list_del(&p->oom_victim_list); > /* Drop a reference taken by mark_oom_victim(). */ > put_task_struct(p); > } > if (gaveup) > debug_show_all_locks(); > > return ret; > } >