Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1627972pxb; Mon, 13 Sep 2021 01:45:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQhugwskHZ8ImUBHYlcnd3YnCZPFol/P9pLR6NINN4E91guGkWmvPjaeif3Q783kTN/TFz X-Received: by 2002:a17:906:fa05:: with SMTP id lo5mr10905577ejb.204.1631522712690; Mon, 13 Sep 2021 01:45:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631522712; cv=none; d=google.com; s=arc-20160816; b=0qSSwTcCNBhB2mHasVNc1COCo0amb7mqCVuDcqGCOJRIY5d7Udr4P/zI/wR7v1zAd4 h/4XuT3pZavGOzY0xSciZxYfdQkrnIo40FyOzyl/7Ml3sRi1g7zrikSLDHYCs/df0ywV iHXwH/JgWbh45Rm7Jtq39ZHxmARiMPb8mYa5wNkJ6lz52sJNms7MHtu7e+ty75BLfRAC 4uk2upPhobY7UbbfbIRdA0ZMrQiKnYhF6xA28or4U2wCYn1MIhpmsCpYz57EId2is2pV +2Gl0Nj5kLMYrRJJ+yynl0k8DrT1qftBvYAoB5DwR56/OgtX/7VMMVkyDUFNDY081JFI DpEw== 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=8kanT9LvCczrJLW86//mm44q0kFal7DLHz1meuR6IX0=; b=alITuFZ7Ve7s6Yrq0WowYgVch+ZXiMxS0s8PhVGAAD+pkL9xeDN6XN4LQAb9sc5OPM MmV9jlIRibfSeWigHTikEsNr+KEBTjOwn7XCWbHraK+MzYfyGqlk9gx8puMhH9KthoxS 6GkMNd+eFk5NrRTKOryLpohIhymLdyU/Slh7JIKU3EP6PVRZcu+kNFIa151XIB3fFIqS Fm5yrwvN8GVdu8AuwuaGH/tWD741Z/lfsULxmuVyJp7XLSZ9ZPP04nd/g0OSelU39rRk wWYGHFwyuM2JKskP51ui0B5Vf2cLvAD+Mudyu3L/+igp+KRsy2dURMER2UlshPdwglxb lOEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=auSFP3cS; 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 h12si3135743edb.337.2021.09.13.01.44.49; Mon, 13 Sep 2021 01:45:12 -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=auSFP3cS; 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 S237858AbhIMIo3 (ORCPT + 99 others); Mon, 13 Sep 2021 04:44:29 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:50482 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237831AbhIMIoP (ORCPT ); Mon, 13 Sep 2021 04:44:15 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 3F5CC1FFAC; Mon, 13 Sep 2021 08:42:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1631522577; 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=8kanT9LvCczrJLW86//mm44q0kFal7DLHz1meuR6IX0=; b=auSFP3cSbtLDH8/xVJew4IJ/MN1dguOz5Le3URoMTqsmLf9D172qnDKyHsvueFiQpQni+V iqYmA0o/CA185fT9Fu5DYTdrKJ9FsKsopivFohrGz4IA4xpbdx8zaR0+EF8n/DbRV2DeGq KjLTsEbgxqHjGwGRRe1FlKKen1sn0b8= 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 09F27A3B8E; Mon, 13 Sep 2021 08:42:56 +0000 (UTC) Date: Mon, 13 Sep 2021 10:42:56 +0200 From: Michal Hocko To: Vasily Averin Cc: Tetsuo Handa , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Johannes Weiner , Vladimir Davydov , Andrew Morton Subject: Re: [PATCH memcg] memcg: prohibit unconditional exceeding the limit of dying tasks Message-ID: References: <5b06a490-55bc-a6a0-6c85-690254f86fad@virtuozzo.com> <099aa0db-045a-e5b8-6df7-b7c3fc4d3caa@i-love.sakura.ne.jp> <4a407474-ff7a-9e4f-d314-ab85f0eeaadf@virtuozzo.com> <9556c2ae-2dc8-9d0a-55de-002d674680bf@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9556c2ae-2dc8-9d0a-55de-002d674680bf@virtuozzo.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 13-09-21 11:29:37, Vasily Averin wrote: > On 9/10/21 5:55 PM, Michal Hocko wrote: > > On Fri 10-09-21 16:20:58, Vasily Averin wrote: > >> On 9/10/21 4:04 PM, Tetsuo Handa wrote: > >>> Can't we add fatal_signal_pending(current) test to vmalloc() loop? > > > > We can and we should. > > > >> 1) this has been done in the past but has been reverted later. > > > > The reason for that should be addressed IIRC. > > I don't know the details of this, and I need some time to investigate it. b8c8a338f75e ("Revert "vmalloc: back off when the current task is killed"") should give a good insight and references. > >> 2) any vmalloc changes will affect non-memcg allocations too. > >> If we're doing memcg-related checks it's better to do it in one place. > > > > I think those two things are just orthogonal. Bailing out from vmalloc > > early sounds reasonable to me on its own. Allocating a large thing that > > is likely to go away with the allocating context is just a waste of > > resources and potential reason to disruptions to others. > > I doubt that fatal signal should block any vmalloc allocations. > I assume there are situations where rollback of some cancelled operation uses vmalloc. > Or coredump saving on some remote storage can uses vmalloc. If there really are any such requirements then this should be really documented. > However for me it's abnormal that even OOM-killer cannot cancel huge vmalloc allocation. > So I think tsk_is_oom_victim(current) check should be added to vm_area_alloc_pages() > to break vmalloc cycle. Why should oom killed task behave any different than any other task killed without a way to handle the signal? -- Michal Hocko SUSE Labs