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=-11.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL 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 33075C433E1 for ; Thu, 20 Aug 2020 15:57:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E6C382054F for ; Thu, 20 Aug 2020 15:57:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="YqSAg0s4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E6C382054F Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 65D568D0026; Thu, 20 Aug 2020 11:57:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 632EE8D0001; Thu, 20 Aug 2020 11:57:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 523838D0026; Thu, 20 Aug 2020 11:57:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0178.hostedemail.com [216.40.44.178]) by kanga.kvack.org (Postfix) with ESMTP id 3C5AD8D0001 for ; Thu, 20 Aug 2020 11:57:07 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id E925E180AD804 for ; Thu, 20 Aug 2020 15:57:06 +0000 (UTC) X-FDA: 77171400852.22.roof26_6308cfe27031 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id AF7A518038E68 for ; Thu, 20 Aug 2020 15:57:06 +0000 (UTC) X-HE-Tag: roof26_6308cfe27031 X-Filterd-Recvd-Size: 6864 Received: from mail-vk1-f195.google.com (mail-vk1-f195.google.com [209.85.221.195]) by imf48.hostedemail.com (Postfix) with ESMTP for ; Thu, 20 Aug 2020 15:57:06 +0000 (UTC) Received: by mail-vk1-f195.google.com with SMTP id l184so519072vki.10 for ; Thu, 20 Aug 2020 08:57:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Q4d3kdKf0obUvj6BD1aZYTd/t86niyv+Yj9Gy9WROoE=; b=YqSAg0s40etVJaOExgte1ifu2Pavm6LhmkJctcS7Eg9t88YKapWGgx/s/ThR4n3gI/ R7P41936QG3xrZ3aenbnC5iMcteiNtbfCqpJyel+R2T3a3+mmGnzlBu+eeX+G/uQJEKn TXM6OdIOs0fbJPDydqUaZTNVwRmplSLNUJhI/nGXOc/ukhJ3Mb/mrOksdinhqE138+jw vMEIr2c4YsjkZIz9JZLkdhKkoG1sFY5Xizkj+qcfkOOMqg4M7lmJFWGpLYY0ImbcvhIC 22rvhHNOcmw5ccAzPcMLQULrXkXH7gQrSt3Z4HLYiv8x9D/WH49eUPC/byTP6D7koGCa Tjxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Q4d3kdKf0obUvj6BD1aZYTd/t86niyv+Yj9Gy9WROoE=; b=qlzxgz/DHdZK/9LAQwnrziQqW2el5Lw4SEJBlB4Tpt/yKQaOCBohZrM+AGBdwwlRdW AM42qfZViooNWQOXZ749VrKRWHDtczQLNtCTjF1rqAYKcxwUvpag1CCNc7rPJcpqQpyX aUqbWZU+j1x9S6EBnLKh7xxQBkt6dQZSqwT/fYhvD4DHuM5HIUhIvc0s5ipzOLyaCDEp D6ypd/LMG8oGoLU2eBD9qc5Qd4/I2p6SjYcXmPt4yvw+hPOw4JPZIod8sJu7adj/HRxk RZlevT6pv4twioteOEygTcvYKu9S6geYAvtukURJuMkP8MDtrzay/ZjVjC9J7EaEddwM PCCw== X-Gm-Message-State: AOAM533ZGGq9WMxB0sCw9Tml9ckOg5VhoOCoEJeUv3Bcx87gvIwcIjur sh9pSJ2AXJZthQgOuC7b24I+JNR4xYGu8A3GTBfnMQ== X-Google-Smtp-Source: ABdhPJziweArgy/me/pR4a4bp4DqBBECsdWvARMwhCbGMB4PwffKzdC/k6cgBhYQ/8RdLDMwP6Q8t3VpwQ5VK740eMI= X-Received: by 2002:a1f:5e4f:: with SMTP id s76mr2096168vkb.37.1597939025123; Thu, 20 Aug 2020 08:57:05 -0700 (PDT) MIME-Version: 1.0 References: <20200820002053.1424000-1-surenb@google.com> <87zh6pxzq6.fsf@x220.int.ebiederm.org> <20200820124241.GJ5033@dhcp22.suse.cz> <87lfi9xz7y.fsf@x220.int.ebiederm.org> <87d03lxysr.fsf@x220.int.ebiederm.org> <20200820132631.GK5033@dhcp22.suse.cz> <20200820133454.ch24kewh42ax4ebl@wittgenstein> <20200820140054.fdkbotd4tgfrqpe6@wittgenstein> <637ab0e7-e686-0c94-753b-b97d24bb8232@i-love.sakura.ne.jp> <87k0xtv0d4.fsf@x220.int.ebiederm.org> In-Reply-To: <87k0xtv0d4.fsf@x220.int.ebiederm.org> From: Suren Baghdasaryan Date: Thu, 20 Aug 2020 08:56:53 -0700 Message-ID: Subject: Re: [PATCH 1/1] mm, oom_adj: don't loop through tasks in __set_oom_adj when not necessary To: "Eric W. Biederman" Cc: Tetsuo Handa , Christian Brauner , Michal Hocko , Tim Murray , mingo@kernel.org, Peter Zijlstra , Thomas Gleixner , esyr@redhat.com, christian@kellner.me, areber@redhat.com, Shakeel Butt , cyphar@cyphar.com, Oleg Nesterov , adobriyan@gmail.com, Andrew Morton , gladkov.alexey@gmail.com, Michel Lespinasse , daniel.m.jordan@oracle.com, avagin@gmail.com, bernd.edlinger@hotmail.de, John Johansen , laoar.shao@gmail.com, Minchan Kim , kernel-team , LKML , linux-fsdevel@vger.kernel.org, linux-mm Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: AF7A518038E68 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 Thu, Aug 20, 2020 at 7:53 AM Eric W. Biederman wrote: > > Tetsuo Handa writes: > > > On 2020/08/20 23:00, Christian Brauner wrote: > >> On Thu, Aug 20, 2020 at 10:48:43PM +0900, Tetsuo Handa wrote: > >>> On 2020/08/20 22:34, Christian Brauner wrote: > >>>> On Thu, Aug 20, 2020 at 03:26:31PM +0200, Michal Hocko wrote: > >>>>> If you can handle vfork by other means then I am all for it. There were > >>>>> no patches in that regard proposed yet. Maybe it will turn out simpler > >>>>> then the heavy lifting we have to do in the oom specific code. > >>>> > >>>> Eric's not wrong. I fiddled with this too this morning but since > >>>> oom_score_adj is fiddled with in a bunch of places this seemed way more > >>>> code churn then what's proposed here. > >>> > >>> I prefer simply reverting commit 44a70adec910d692 ("mm, oom_adj: make sure > >>> processes sharing mm have same view of oom_score_adj"). > >>> > >>> https://lore.kernel.org/patchwork/patch/1037208/ > >> > >> I guess this is a can of worms but just or the sake of getting more > >> background: the question seems to be whether the oom adj score is a > >> property of the task/thread-group or a property of the mm. I always > >> thought the oom score is a property of the task/thread-group and not the > >> mm which is also why it lives in struct signal_struct and not in struct > >> mm_struct. But > >> > >> 44a70adec910 ("mm, oom_adj: make sure processes sharing mm have same view of oom_score_adj") > >> > >> reads like it is supposed to be a property of the mm or at least the > >> change makes it so. > > > > Yes, 44a70adec910 is trying to go towards changing from a property of the task/thread-group > > to a property of mm. But I don't think we need to do it at the cost of "__set_oom_adj() latency > > Yong-Taek Lee and Tim Murray have reported" and "complicity for supporting > > vfork() => __set_oom_adj() => execve() sequence". > > The thing is commit 44a70adec910d692 ("mm, oom_adj: make sure processes > sharing mm have same view of oom_score_adj") has been in the tree for 4 > years. > > That someone is just now noticing a regression is their problem. The > change is semantics is done and decided. We can not reasonably revert > at this point without risking other regressions. > > Given that the decision has already been made to make oom_adj > effectively per mm. There is no point on have a debate if we should do > it. Catching up on the discussion which was going on while I was asleep... So it sounds like there is a consensus that oom_adj should be moved to mm_struct rather than trying to synchronize it among tasks sharing mm. That sounds reasonable to me too. Michal answered all the earlier questions about this patch, so I won't be reiterating them, thanks Michal. If any questions are still lingering about the original patch I'll be glad to answer them. > > Eric > >