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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,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 5B990C433E1 for ; Thu, 20 Aug 2020 14:34:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 24C752076E for ; Thu, 20 Aug 2020 14:34:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 24C752076E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B38A78D0026; Thu, 20 Aug 2020 10:34:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AE8828D0002; Thu, 20 Aug 2020 10:34:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9FEED8D0026; Thu, 20 Aug 2020 10:34:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0139.hostedemail.com [216.40.44.139]) by kanga.kvack.org (Postfix) with ESMTP id 8B5288D0002 for ; Thu, 20 Aug 2020 10:34:36 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 37D82180AD81A for ; Thu, 20 Aug 2020 14:34:36 +0000 (UTC) X-FDA: 77171192952.13.chair52_5b0ded427031 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id E873418140B60 for ; Thu, 20 Aug 2020 14:34:35 +0000 (UTC) X-HE-Tag: chair52_5b0ded427031 X-Filterd-Recvd-Size: 3469 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Thu, 20 Aug 2020 14:34:35 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 772DDAF50; Thu, 20 Aug 2020 14:35:01 +0000 (UTC) Date: Thu, 20 Aug 2020 16:34:33 +0200 From: Michal Hocko To: Tetsuo Handa Cc: Christian Brauner , "Eric W. Biederman" , Suren Baghdasaryan , timmurray@google.com, mingo@kernel.org, peterz@infradead.org, tglx@linutronix.de, esyr@redhat.com, christian@kellner.me, areber@redhat.com, shakeelb@google.com, cyphar@cyphar.com, oleg@redhat.com, adobriyan@gmail.com, akpm@linux-foundation.org, gladkov.alexey@gmail.com, walken@google.com, daniel.m.jordan@oracle.com, avagin@gmail.com, bernd.edlinger@hotmail.de, john.johansen@canonical.com, laoar.shao@gmail.com, minchan@kernel.org, kernel-team@android.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 1/1] mm, oom_adj: don't loop through tasks in __set_oom_adj when not necessary Message-ID: <20200820143433.GO5033@dhcp22.suse.cz> References: <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> <20200820141538.GM5033@dhcp22.suse.cz> <42d5645e-0364-c8cd-01dc-93a9aaff5b09@i-love.sakura.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42d5645e-0364-c8cd-01dc-93a9aaff5b09@i-love.sakura.ne.jp> X-Rspamd-Queue-Id: E873418140B60 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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 20-08-20 23:26:29, Tetsuo Handa wrote: > On 2020/08/20 23:15, Michal Hocko wrote: > > I would tend to agree that from the userspace POV it is nice to look at > > oom tuning per process but fundamentaly the oom killer operates on the > > address space much more than other resources bound to a process because > > it is usually the address space hogging the largest portion of the > > memory footprint. This is the reason why the oom killer has been > > evaluating tasks based on that aspect rather than other potential memory > > consumers bound to a task. Mostly due to lack of means to evaluate > > those. > > We already allow specifying potential memory consumers via oom_task_origin(). oom_task_origin is a single purpose hack to handle swapoff situation more gracefully. By no means this is something to base the behavior on. > If we change from a property of the task/thread-group to a property of mm, > we won't be able to add means to adjust oom score based on other potential > memory consumers bound to a task (e.g. pipes) in the future. While that would be really nice to achieve I am not really sure this is feasible. Mostly because accounting shared resources like pipes but fd based resources in general is really hard to do right without any surprises. Pipes are not really bound to a specific process for example. You are free to hand over fd to a different process for example. -- Michal Hocko SUSE Labs