Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1097634pxb; Thu, 28 Jan 2021 07:59:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJyz7s9hLDUh+HrMicQFOCRRfbBVhys8A76E5ZfIA+k1cCprq+6JQCoCeURd844/o8gNaCoR X-Received: by 2002:a05:6402:c9:: with SMTP id i9mr165770edu.123.1611849566917; Thu, 28 Jan 2021 07:59:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611849566; cv=none; d=google.com; s=arc-20160816; b=YmOM8cv2pJ8dAssKbJa5KVrR/JS+ZQzoO1KYMKkFCP/Q+0qNWdgdI/h76Zh90cdb2c LyEY7SyzPoHPQZOhMZ6HcA4uSKAXfCs023iYm3efq+7GIEPoCwxw90E+m6SET/3J8fM7 wfpOIH3uogjgjRsdOvPdJ4VyGdn2SZnawvHkx/u/Uk9hTdCIdTN1GgxsMfHu3oapZev0 PxfwSwHBvRmknTxPs+jtxsrV0RCn221CxIIFMEdo44U5SEwSNzPMC0o98TXnxyEN1nkL uEZL6Bdpo+30Wr7IyvsviVAquqKlMYEmX6pRRPIn87omajVjM3V5NX94O0RcXONjDWCT vD7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=RqB/4YG3VUCKs0RRgyCsqFMi7oXYXhHgDEx39sg1J90=; b=lQvt8y9UNZI+YWvIzDz1/NugTpTPKouIojzaRbHXe2v6Zl2waKjPh1DtgL/s6HZT8g QrHFFRbHnbxYrZAjMcuo1dKON4WRRlrvZpYhVZq9PK2Ly+6+EobdXsPvb+GwLauu9OdW uez4UMvMnljkKH/8PF2C1ooPaY/no0h8whOwUg2/dykdKxT+d4h1CgP/sQxWo3Ooh5Fl +gxy9KJWyk+7nWaFY8N9pMT+k7KsCKmuxjD1mXsffOZCsS6tjSjEs0P5YI1WN7qOE2uk lEgehuAf76iyyvSKTnbV9B0+eDpWocaeBLeS+HObgAwGsiVVOpMri/1tAjiYIO7Vak3A sRJA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b1si3208636ejb.314.2021.01.28.07.58.57; Thu, 28 Jan 2021 07:59:26 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232025AbhA1P5b (ORCPT + 99 others); Thu, 28 Jan 2021 10:57:31 -0500 Received: from gentwo.org ([3.19.106.255]:44642 "EHLO gentwo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229885AbhA1P53 (ORCPT ); Thu, 28 Jan 2021 10:57:29 -0500 Received: by gentwo.org (Postfix, from userid 1002) id 70A813F4C1; Thu, 28 Jan 2021 15:56:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 6DA583F461; Thu, 28 Jan 2021 15:56:36 +0000 (UTC) Date: Thu, 28 Jan 2021 15:56:36 +0000 (UTC) From: Christoph Lameter X-X-Sender: cl@www.lameter.com To: Michal Hocko cc: Mike Rapoport , David Hildenbrand , Andrew Morton , Alexander Viro , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Dan Williams , Dave Hansen , Elena Reshetova , "H. Peter Anvin" , Ingo Molnar , James Bottomley , "Kirill A. Shutemov" , Matthew Wilcox , Mark Rutland , Mike Rapoport , Michael Kerrisk , Palmer Dabbelt , Paul Walmsley , Peter Zijlstra , Rick Edgecombe , Roman Gushchin , Shakeel Butt , Shuah Khan , Thomas Gleixner , Tycho Andersen , Will Deacon , linux-api@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-nvdimm@lists.01.org, linux-riscv@lists.infradead.org, x86@kernel.org, Hagen Paul Pfeifer , Palmer Dabbelt Subject: Re: [PATCH v16 07/11] secretmem: use PMD-size pages to amortize direct map fragmentation In-Reply-To: Message-ID: References: <20210121122723.3446-1-rppt@kernel.org> <20210121122723.3446-8-rppt@kernel.org> <20210126114657.GL827@dhcp22.suse.cz> <303f348d-e494-e386-d1f5-14505b5da254@redhat.com> <20210126120823.GM827@dhcp22.suse.cz> <20210128092259.GB242749@kernel.org> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 28 Jan 2021, Michal Hocko wrote: > > > If you kill the allocating process then yes, it would work, but your > > > process might be the very last to be selected. > > > > OOMs are different if you have a "constrained allocation". In that case it > > is the fault of the process who wanted memory with certain conditions. > > That memory is not available. General memory is available though. In that > > case the allocating process is killed. > > I do not see this implementation would do anything like that. Neither > anything like that implemented in the oom killer. Constrained > allocations (cpusets/memcg/mempolicy) only do restrict their selection > to processes which belong to the same domain. So I am not really sure > what you are referring to. The is only a global knob to _always_ kill > the allocating process on OOM. Constrained allocations refer to allocations where the NUMA nodes are restricted or something else does not allow the use of arbitrary memory. The OOM killer changes its behavior. In the past we fell back to killing the calling process. See constrained_alloc() in mm/oom_kill.c static const char * const oom_constraint_text[] = { [CONSTRAINT_NONE] = "CONSTRAINT_NONE", [CONSTRAINT_CPUSET] = "CONSTRAINT_CPUSET", [CONSTRAINT_MEMORY_POLICY] = "CONSTRAINT_MEMORY_POLICY", [CONSTRAINT_MEMCG] = "CONSTRAINT_MEMCG", }; /* * Determine the type of allocation constraint. */ static enum oom_constraint constrained_alloc(struct oom_control *oc) {