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 51A6CC433E0 for ; Thu, 16 Jul 2020 06:12:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1B78720578 for ; Thu, 16 Jul 2020 06:12:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B78720578 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 B2C3F8D0002; Thu, 16 Jul 2020 02:11:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ADCAF6B000C; Thu, 16 Jul 2020 02:11:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9CB338D0002; Thu, 16 Jul 2020 02:11:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0168.hostedemail.com [216.40.44.168]) by kanga.kvack.org (Postfix) with ESMTP id 847BA6B0008 for ; Thu, 16 Jul 2020 02:11:59 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 4887D181AC9C6 for ; Thu, 16 Jul 2020 06:11:59 +0000 (UTC) X-FDA: 77042918358.06.ant08_2d14f3f26eff Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin06.hostedemail.com (Postfix) with ESMTP id 196D41004816B for ; Thu, 16 Jul 2020 06:11:59 +0000 (UTC) X-HE-Tag: ant08_2d14f3f26eff X-Filterd-Recvd-Size: 4379 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Thu, 16 Jul 2020 06:11:58 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id z2so5748483wrp.2 for ; Wed, 15 Jul 2020 23:11:58 -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=d05frahHqei+FM4guzFY6q128Nu1iO09T9oHXm1e3oU=; b=iqhcTthGGPTOIqufU2BzG9lKLKniUWoeww+U1BO32E355BmzuNQwcwUriaE6d1AIwa giW43TyzT9hWKQ6TVKRaFpYt/rZQ2vuI4G/Sp/J2/Qcx0pvup673elXIraA4Ao2qQJ93 6TEDal6/HWi9uPCWYqOaJ4ZGk0F4sPF5YQyiAZyAspCjhSa6L0GSXIMdnnwkl+eLMXpb bvZKJ10aOEBS6gvS5a1x+HgwmRZ/on3aiUtmBpPi3Fo9ULN6xGDndt5mK1CKQNMtXDXo 7F0c3o6jruxYWsjvBlas5NB/STHlhlchcCQM/HoHy6VEYcqHB5PD40M4Y0XHdKoNDQuK Eqmw== X-Gm-Message-State: AOAM533bgJrL95Bqpj5VT+0KE94NjjJ5lbyBYfcFmrjqCaEh52svZYX+ 6vP39QTvoHLGvFILZAFtgXk= X-Google-Smtp-Source: ABdhPJxW8CdvqI0qdNsBDm6th8nr+fjpjnZc/TlTDtJtCLnH0L/RKms5lYU31opVgkvJbLTVGylENw== X-Received: by 2002:adf:c185:: with SMTP id x5mr3598047wre.403.1594879917627; Wed, 15 Jul 2020 23:11:57 -0700 (PDT) Received: from localhost (ip-37-188-169-187.eurotel.cz. [37.188.169.187]) by smtp.gmail.com with ESMTPSA id d81sm3586075wmc.0.2020.07.15.23.11.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2020 23:11:56 -0700 (PDT) Date: Thu, 16 Jul 2020 08:11:56 +0200 From: Michal Hocko To: Tetsuo Handa Cc: David Rientjes , Yafang Shao , Andrew Morton , Johannes Weiner , Linux MM Subject: Re: [PATCH v2] memcg, oom: check memcg margin for parallel oom Message-ID: <20200716061156.GB31089@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: 196D41004816B X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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 Thu 16-07-20 14:54:01, Tetsuo Handa wrote: > On 2020/07/16 2:30, David Rientjes wrote: > > But regardless of whether we present previous data to the user in the > > kernel log or not, we've determined that oom killing a process is a > > serious matter and go to any lengths possible to avoid having to do it. > > For us, that means waiting until the "point of no return" to either go > > ahead with oom killing a process or aborting and retrying the charge. > > > > I don't think moving the mem_cgroup_margin() check to out_of_memory() > > right before printing the oom info and killing the process is a very > > invasive patch. Any strong preference against doing it that way? I think > > moving the check as late as possible to save a process from being killed > > when racing with an exiter or killed process (including perhaps current) > > has a pretty clear motivation. > > > > How about ignoring MMF_OOM_SKIP for once? I think this has almost same > effect as moving the mem_cgroup_margin() check to out_of_memory() > right before printing the oom info and killing the process. How would that help with races when a task is exiting while the oom selects a victim? We are not talking about races with the oom_reaper IIUC. Btw. if races with the oom_reaper are a concern then I would much rather delay the wake up than complicate the existing protocol even further. -- Michal Hocko SUSE Labs