Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4227989pxj; Tue, 8 Jun 2021 09:19:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxfelYmWgZ6ask6tKdzlihtmCiQAKF7RRdgAIC24P69DVE0mcQA8JF/8aVOVLLbq7YkiP6 X-Received: by 2002:aa7:c782:: with SMTP id n2mr26363352eds.77.1623169155536; Tue, 08 Jun 2021 09:19:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623169155; cv=none; d=google.com; s=arc-20160816; b=zCb2NDtmtxlPNONolSduEi4tUURZPKwDF4vLj9xHPAnKsKxWtlb6Y4uPaIpncnTKUS wVEO95qH5SRX5LrcMj42VYLCle1SN2LnqzM69/yM2t7VTeCrbZOzKFK7FYz/C/h/5SQV qMbSLBKYjJniAH59VyparQG9oG19rOHgagOEWiSoP7cMusND8pXRDFgulstAN/tQmr8z 3DKHBh8SbjslMfuC4YUkw3qqtQMUwqlQAE/905xElSkXTllHVd0b4RXiPNYI+Y5wStm4 Zu9gGysRN4y1qygU6odjbc5+IlVGAALyVi/iXpKP+0AqK3xECmYgkEOpUZKpSM6jRJUY RIOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Gi8XCTYoavMm87bNCuOv2uvqUg6h/75nK0TzemGzaj8=; b=NMmBtg0oGEyaYcNNGah+C/qlvz+9SPVTVLxmUDuQtxa7jyxsGI/89DWDL55ju2joxW sgNMe/EC/rYLZT8d5Sbp5FHmu+AWcx/IK1fCzVKDkQmnzNAnztMOca7nx8VQNDypIBbw xGN99IN49fEJ4t3DrmWhCydZgsD5QQ3SQNamipwQTtFcizFoYNw2X59mQHktHW/rsBZ6 6ttTpBqkSj2jNnmSfXuBrLk38j7eTJwKFFCpTTme2Gf9jJT6sz0H9W/wSR8l4y7JTnsH ymuvCGkLJpqtUbHyl1gdbKHDhOsDeNOJXT2G3YhtiEI3KvVIzgBsrEVFm4aM9jtHQbyF vZtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=e8p9f0vs; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k6si105750edq.273.2021.06.08.09.18.51; Tue, 08 Jun 2021 09:19:15 -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=pass header.i=@suse.com header.s=susede1 header.b=e8p9f0vs; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230523AbhFHQTX (ORCPT + 99 others); Tue, 8 Jun 2021 12:19:23 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:46354 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230222AbhFHQTV (ORCPT ); Tue, 8 Jun 2021 12:19:21 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 3EFFF1FD33; Tue, 8 Jun 2021 16:17:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1623169047; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Gi8XCTYoavMm87bNCuOv2uvqUg6h/75nK0TzemGzaj8=; b=e8p9f0vstQUoeVxfIg4N5nt8NmysE+kFUj4CTZtHPu5RKJDqWxzzwtwxa3LlSVjbf86Vp0 gPMv0eAkmM4/HqdfUHsZLtqM+DKYI534IubzVOzQNcH8mPDMZ5DXPBd0lzHXAoneO5TSIz Ac2gekzihAmN6m4TRxXc/yqJiJbt+OU= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id A37EBA3B85; Tue, 8 Jun 2021 16:17:26 +0000 (UTC) Date: Tue, 8 Jun 2021 18:17:25 +0200 From: Michal Hocko To: Tetsuo Handa Cc: Aaron Tomlin , Waiman Long , Shakeel Butt , Linux MM , Andrew Morton , Vlastimil Babka , LKML Subject: Re: [RFC PATCH] mm/oom_kill: allow oom kill allocating task for non-global case Message-ID: References: <6d23ce58-4c4b-116a-6d74-c2cf4947492b@redhat.com> <353d012f-e8d4-c54c-b33e-54737e1a0115@redhat.com> <20210608100022.pzuwa6aiiffnoikx@ava.usersys.com> <931bbf2e-19e3-c598-c244-ae5e7d00dfb0@i-love.sakura.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <931bbf2e-19e3-c598-c244-ae5e7d00dfb0@i-love.sakura.ne.jp> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 09-06-21 00:22:13, Tetsuo Handa wrote: > On 2021/06/08 22:58, Michal Hocko wrote: > > I do not see this message to be ever printed on 4.18 for memcg oom: > > /* Found nothing?!?! Either we hang forever, or we panic. */ > > if (!oc->chosen && !is_sysrq_oom(oc) && !is_memcg_oom(oc)) { > > dump_header(oc, NULL); > > panic("Out of memory and no killable processes...\n"); > > } > > > > So how come it got triggered here? Is it possible that there is a global > > oom killer somehow going on along with the memcg OOM? Because the below > > stack clearly points to a memcg OOM and a new one AFAICS. > > 4.18 does print this message, and panic() will be called if global OOM > killer invocation were in progress. > > 4.18.0-193.51.1.el8.x86_64 is doing > > ---------- > select_bad_process(oc); > /* Found nothing?!?! */ > if (!oc->chosen) { > dump_header(oc, NULL); > pr_warn("Out of memory and no killable processes...\n"); > /* > * If we got here due to an actual allocation at the > * system level, we cannot survive this and will enter > * an endless loop in the allocator. Bail out now. > */ > if (!is_sysrq_oom(oc) && !is_memcg_oom(oc)) > panic("System is deadlocked on memory\n"); > } > ---------- Ahh, OK. That would explain that. I have looked at 4.18 Vanilla kernel. I do not have RHEL sources handy and neither checked the 4.18 stable tree. Thanks for the clarification! [...] > Since dump_tasks() from dump_header(oc, NULL) does not exclude tasks > which already has MMF_OOM_SKIP set, it is possible that the last OOM > killable victim was already OOM killed but the OOM reaper failed to reclaim > memory and set MMF_OOM_SKIP. (Well, maybe we want to exclude (or annotate) > MMF_OOM_SKIP tasks when showing OOM victim candidates...) Well, the allocating task was clearly alive and whether it has been reaped or not is not all that important as it should force the charge as an oom victim. This is actually the most puzzling part. Because the allocating task either is not a preexisting OOM victim and therefore could become one or it has been and should have skipped the memcg killer altogether. But I fail to see how it could be missed completely while looking for a victim. -- Michal Hocko SUSE Labs