Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp998525pxb; Thu, 28 Jan 2021 05:53:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJzVcp4v9x4ahH9O+p2RYNjwdJDkpUi1snpyyCLI6IMPoD8tYAY2ztrDR+MRWtTkiriGSedx X-Received: by 2002:a05:6402:95a:: with SMTP id h26mr13681195edz.288.1611842026842; Thu, 28 Jan 2021 05:53:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611842026; cv=none; d=google.com; s=arc-20160816; b=A5jnd/iNmSGm+38vtPq/VJHoMM5IptWn+rY6wVirWyW1ARWei7RxQOEA068rQrEMZ1 NPffN5EVNDC1ZGAABZCmjRVprKp0C90uSuqSXLITmbH6xfB4kBmy7tWd1f14jIxXy7Nb zHejE9EnFgmCrhJWJwAMJKJf9gX8X08Q5It/t4I1Gvwwc5Z7m96uWaNQHm0Y0uajtZH3 AjpfQ90+eplIeD+0nBiZc0VxUpM5nm7D998jCWgO+h8Nyww/dNcneCKd+k9VfSP/uUEq hnF9ovu+0YN8V/iaKywVAW1WJA7lEj+uW/PJf39744DXkoxtkkUffGwuz7l+Ky1k6x4l +8OQ== 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=75llh3uw6L6UpTgmVsHlz+i8LHZJ84jNMGnauBZqITc=; b=o6a6g6r6EMmcMcFRmJr693m7bdk8XSvzBuL9ibbj1+yYxhXBzJP8P4GowlZhjLGJYU 1PmY2YyooN5IoWu5/VXmXN/luU6KYNR7a6++FIANTIkE2dUDxmAlfBELjRLPto4flfB/ fMRAUYBsRp7GjC0yyfJq2xGsTgAxSNd59lptwTVTrJvCQ1hdxZQiYRUBI42gQZrH2IRf GyaOtzXrl2tsSe5FX6jkUyyMoQOeEaFFM1Js785/OhW0YDs/o6oGLYrlnEPdj1+Uxfsp ODwifpUlW3WTdlbnCeZGgu90G/XFCy1Uf349C+l4aB5K4DGEGT0H2O12iarlhVyx7foL uYiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="RFEQmGK/"; 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 i20si2372677edv.576.2021.01.28.05.53.21; Thu, 28 Jan 2021 05:53:46 -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; dkim=pass header.i=@suse.com header.s=susede1 header.b="RFEQmGK/"; 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 S231226AbhA1NuZ (ORCPT + 99 others); Thu, 28 Jan 2021 08:50:25 -0500 Received: from mx2.suse.de ([195.135.220.15]:37626 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229811AbhA1NuW (ORCPT ); Thu, 28 Jan 2021 08:50:22 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1611841775; 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=75llh3uw6L6UpTgmVsHlz+i8LHZJ84jNMGnauBZqITc=; b=RFEQmGK/LljkSM2oiWx77CIGoV0eKNOaEQIEAkrhzpN9jbb3MOKURRCYaRwYVt6/w/U/+e g4VVantqh8P7n2dKzYTMYQk4w9MXZKXSASL6hjd+n4xFytPepUsla6MMacf9DtnSP1AmZ/ v2BcnFvMM+kSY0c0Ye3UOYH/R63VQ8Q= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 9E752AF78; Thu, 28 Jan 2021 13:49:35 +0000 (UTC) Date: Thu, 28 Jan 2021 14:49:34 +0100 From: Michal Hocko To: Christoph Lameter 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 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 28-01-21 13:28:10, Cristopher Lameter wrote: > 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. 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. -- Michal Hocko SUSE Labs