From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA724C433EB for ; Wed, 15 Jul 2020 06:56:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 58FFA2067D for ; Wed, 15 Jul 2020 06:56:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 58FFA2067D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9181C6B0002; Wed, 15 Jul 2020 02:56:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8C84A6B0003; Wed, 15 Jul 2020 02:56:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7DF456B0005; Wed, 15 Jul 2020 02:56:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0144.hostedemail.com [216.40.44.144]) by kanga.kvack.org (Postfix) with ESMTP id 67BE16B0002 for ; Wed, 15 Jul 2020 02:56:31 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id B23B9180AD817 for ; Wed, 15 Jul 2020 06:56:30 +0000 (UTC) X-FDA: 77039401740.23.cakes43_0c16d3226ef7 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id 78E5F3760C for ; Wed, 15 Jul 2020 06:56:30 +0000 (UTC) X-HE-Tag: cakes43_0c16d3226ef7 X-Filterd-Recvd-Size: 3709 Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Wed, 15 Jul 2020 06:56:30 +0000 (UTC) Received: by mail-ed1-f67.google.com with SMTP id a8so811835edy.1 for ; Tue, 14 Jul 2020 23:56:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=bUNAGiqRCQU9Eqb0jQJr8zEjVq2bzNFdGMNuahRSW50=; b=XxFAw5SxNlXTp6T4D71KFpl7gGSuhwsVFLc7aa6XqCgSC6828TVVvuHcJ0P1Rr+X8m uBQcECqXOKh8eDMyy/uedklGPIpTY+ZqCrUmTsdh1V/67Biew7663SoNxjGJDrkYuvog w1/sjfiNHu8Ka2rsnZeVpnv/99C8B794YA74vweYiEETAxpJMmnuGjqPZGnA1DOWNntn 5pEbvWVJ1qWvEbrtKUfT/RvSIRTynxAqOHdFIU60B7turLh64eOIZ5dq4wGPxBVXbR0/ UgPRbf7VLKCM3pgFVlOnqewMYN7DB6Fi/SknkPD+TUMYc1B7S1HmtK/1rreIMkIHxx6p I4gw== X-Gm-Message-State: AOAM530Rl+y5HykZ5Isg4kv1cwR/jPYKPrwBEIDKnaub5t7i4g6n1Tnk lH42QrX3+p82D6cltsFtu68= X-Google-Smtp-Source: ABdhPJwVzgzo2esgMc4VLuTr5U6dhLxJyuty3/c8QOkruHtIPfWnD1jWb0vEk81xLly8wa+MJFB9ww== X-Received: by 2002:a05:6402:b10:: with SMTP id bm16mr8455236edb.92.1594796188972; Tue, 14 Jul 2020 23:56:28 -0700 (PDT) Received: from localhost (ip-37-188-169-187.eurotel.cz. [37.188.169.187]) by smtp.gmail.com with ESMTPSA id j19sm1212894edt.44.2020.07.14.23.56.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2020 23:56:28 -0700 (PDT) Date: Wed, 15 Jul 2020 08:56:27 +0200 From: Michal Hocko To: Yafang Shao Cc: David Rientjes , Tetsuo Handa , Andrew Morton , Johannes Weiner , Linux MM Subject: Re: [PATCH v2] memcg, oom: check memcg margin for parallel oom Message-ID: <20200715065627.GB5451@dhcp22.suse.cz> References: <1594735034-19190-1-git-send-email-laoar.shao@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 78E5F3760C X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed 15-07-20 11:10:07, Yafang Shao wrote: [...] > If it is the race which causes this issue and we want to reduce the > race window, I don't know whether it is proper to check the memcg > margin in out_of_memory() or do it before calling do_send_sig_info(). > Because per my understanding, dump_header() always takes much more > time than select_bad_process() especially if there're slow consoles. > So the race might easily happen when doing dump_header() or dumping > other information, but if we check the memcg margin after dumping this > oom info, it would be strange to dump so much oom logs without killing > a process. Yes, this is my experience as well. Unless there are gazillions of tasks the oom victim selection should be reasonably swift. It is usually the oom report which takes the most time and this is a huge race window. So I think it would be best to go with your patch for now. It is more in line with the global oom flow and it is much easier to reason about. -- Michal Hocko SUSE Labs