Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp983431pxb; Thu, 28 Jan 2021 05:30:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJzdtX7IWUM7XdIVdpdvnxzrGF3dhc3IZk0w/D96EyOzl1it4s2HdlQ8lkClvdpjLSzQI04x X-Received: by 2002:a05:6402:160f:: with SMTP id f15mr14086129edv.348.1611840636312; Thu, 28 Jan 2021 05:30:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611840636; cv=none; d=google.com; s=arc-20160816; b=Va37SZ+ZovVaXCSK6cTy905IY68oDXVZmQQV/q8hbl20BH2lrIxL0U49DViIjj/x3v LThuY82BzEz+xe+rY5ehIuiyAaAG6f7GZ2ea/MZVw8btzcumK9MQqrQFnPL36GDLRgpd 67xzCfX0GnrusKA+OLqvsi8y8ckvFlxGh0lujD0DxKEcGaDqkT/GAistEvA0WciaOn9s rfYKmEhCP4LI9Fz79Aboxzi9Uqmulh3hSitm8+qb6NqgiJM9AIkLVHy7zJC2jTwTy8R3 9IbSwTJti6VMgNOhTSRtSg476wUXvWiQM+9AmQqgL6MShdYZV2yABwUoHnMXa5DOZ+7W iRsQ== 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=f+hsEBFQzY15C8mK0K6eFBNnWSmldGlN+e1HlVuNAn8=; b=m9iqwhk6JxRtueuHi5cUgfoD0YBNW3gA67azvHY7zF/xTpya5yFkLgYpEKSURngZ5f zeKS6lcMJppEDtrJdOy6xueO0jXNzp3xJKKfP1ajpZQzPm95fvWXykbYlYp6n84syYTb IS6cumRd+eZx1lBrcmKQQPoiCPhP6ZBNXLp8O8HvgCxO29uxouYSuxo3nlPpqxQTsOQ2 7IO5QfJ/d1QqFNUaKgsv58djpMsdR+AHrs+hcGC+XWIAkQPfghF1Dv/YX1GCWpRmpeg8 3o2+UHab8T1Vr7fCvW8xhgXxLghOHC9p5ZDVFgdEod22wP3EOxzgMFwL1XG0vKY/ypjZ 1enQ== 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 d23si2487297ejd.151.2021.01.28.05.30.11; Thu, 28 Jan 2021 05:30:36 -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 S232014AbhA1N3E (ORCPT + 99 others); Thu, 28 Jan 2021 08:29:04 -0500 Received: from gentwo.org ([3.19.106.255]:44534 "EHLO gentwo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231153AbhA1N3C (ORCPT ); Thu, 28 Jan 2021 08:29:02 -0500 Received: by gentwo.org (Postfix, from userid 1002) id 7A84C3F4C1; Thu, 28 Jan 2021 13:28:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 77AFA3F461; Thu, 28 Jan 2021 13:28:10 +0000 (UTC) Date: Thu, 28 Jan 2021 13:28:10 +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: > > So, if I understand your concerns correct this implementation has two > > issues: > > 1) allocation failure at page fault that causes unrecoverable OOM and > > 2) a possibility for an unprivileged user to deplete secretmem pool and > > cause (1) to others > > > > I'm not really familiar with OOM internals, but when I simulated an > > allocation failure in my testing only the allocating process and it's > > parent were OOM-killed and then the system continued normally. > > 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.