Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2486346imm; Mon, 28 May 2018 09:01:06 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq4yuOzUpZZPdRARfNhDSs7As2G/I+TzvXymtMia2VFqFCTrnXbL5a7SGyFkW85uKbfOSyZ X-Received: by 2002:a17:902:22cc:: with SMTP id o12-v6mr14652420plg.38.1527523266030; Mon, 28 May 2018 09:01:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527523266; cv=none; d=google.com; s=arc-20160816; b=UyFxrirVrGYbTtIba+GwX2QHeKxmXNtA7lu1h9ZdM59jFLtBqdbxN3GV861B1IasA/ 8vpKf0d+bmDFytod9G3DQZA4azAi0O5d/Jfiu+BWrwvfDR2BvOhkdB6P+EZSmy02vfQT cZngygvQRKPZ+iA2L4EsVViLUsJIPCnru+4RLZ4VYtAlF4OdJ6v0dC+yFzNQggRA4xuu I36devr7e3z1DKUu0TR7/HpwqS1+JT17peAonM0hSZC1BIEp/2tgRURV4DhYt5YgvyJR icefUsz2AHKNIv13HewMOYvnMQN0ml/2ZfRJ4whNXoEfPD/Hw6zGJz0UopeSnDEXomMo WcIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=GyTk9DjYkOajHWNV4D/3HCn3SPsWXOnXymLnJgSEkqU=; b=jFow4ykzjosiUq3aeYcCM9SGRcu2uXytI6nz2nQBXWp2sNuWfLPGuJeXX3He9tUvrd sXeOv9C9GrPDIJEjV8o5/VaPvMQkawxFbnNJRaxwwP8I2C7cYG1CWNfLLqL5KrWxEkP1 qcMB+agP+3iAFMQJeaM9Kpy24xw57llEu/CAYJMfKcHI2ne+m3AxyTJ+A8Z2HctH55XB b2TZM6vujkJYB+efUAy7faECA8iZBk1wbLdcDE3Bj8UVkdL/OfxW8KZjw7tdfaaOyClq rpyogPCzNhKs5hjKxg6NvKN6of+6YfpYpSdFnT2wlHOZX6v1bCmLOlj4AbAlXvBEYA75 8jNQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l63-v6si29435598plb.49.2018.05.28.09.00.50; Mon, 28 May 2018 09:01:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932798AbeE1P7F (ORCPT + 99 others); Mon, 28 May 2018 11:59:05 -0400 Received: from mx2.suse.de ([195.135.220.15]:43546 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969241AbeE1Px7 (ORCPT ); Mon, 28 May 2018 11:53:59 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id DD3A7AE54; Mon, 28 May 2018 15:53:56 +0000 (UTC) Date: Mon, 28 May 2018 11:03:29 +0200 From: Michal Hocko To: David Rientjes Cc: Andrew Morton , Mike Kravetz , "Aneesh Kumar K.V" , Naoya Horiguchi , Vlastimil Babka , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [patch] mm, hugetlb_cgroup: suppress SIGBUS when hugetlb_cgroup charge fails Message-ID: <20180528090329.GF1517@dhcp22.suse.cz> References: <20180525134459.5c6f8e06f55307f72b95a901@linux-foundation.org> <20180525140940.976ca667f3c6ff83238c3620@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 25-05-18 15:18:11, David Rientjes wrote: [...] > Let's see what Mike and Aneesh say, because they may object to using > VM_FAULT_OOM because there's no way to guarantee that we'll come under the > limit of hugetlb_cgroup as a result of the oom. My assumption is that we > use VM_FAULT_SIGBUS since oom killing will not guarantee that the > allocation can succeed. Yes. And the lack of hugetlb awareness in the oom killer is another reason. There is absolutely no reason to kill a task when somebody misconfigured the hugetlb pool. > But now a process can get a SIGBUS if its hugetlb > pages are not allocatable or its under a limit imposed by hugetlb_cgroup > that it's not aware of. Faulting hugetlb pages is certainly risky > business these days... It's always been and I am afraid it will always be unless somebody simply reimplements the current code to be NUMA aware for example (it is just too easy to drain a per NODE reserves...). > Perhaps the optimal solution for reaching hugetlb_cgroup limits is to > induce an oom kill from within the hugetlb_cgroup itself? Otherwise the > unlucky process to fault their hugetlb pages last gets SIGBUS. Hmm, so you expect that the killed task would simply return pages to the pool? Wouldn't that require to have a hugetlb cgroup OOM killer that would only care about hugetlb reservations of tasks? Is that worth all the effort and the additional code? -- Michal Hocko SUSE Labs