Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1730804pxb; Fri, 29 Jan 2021 03:57:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJzFL22vfrKtknSULSlMHsrbc/W0uJm+RfoAbprR0KlWPR+/UxL8TPemBWSvG0ahkCUx5adG X-Received: by 2002:a05:6402:22db:: with SMTP id dm27mr4707710edb.379.1611921438247; Fri, 29 Jan 2021 03:57:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611921438; cv=none; d=google.com; s=arc-20160816; b=z3eyPdq3LvEbLTrmGO2lKHrFhvs9pHVdncJYArvLEdXfvsvbSj7fnjL1yBzAo4hMpH 2ZCBMPQGKfLPs0QZyRyC0Oz+69qR0qCoXjBcqKIw4dbABj+dxR29HYVF+RYvvDQA+opW l8EHOR4eV923yjZsZCFIo0wmC38FBEkFWL/cTe2j/amtngTKMocU1YPaIqUhub8yW8YC NnUf8LP8Pk+kDrp81cKfJuO9ar9l4iG0Ezt7rBSj5sWVrk/C+3uw4E6MSXAgGwxOfK2f o4FY+aQdFHnOvqyvv8e9TiunZqEzJzSXbzOx5IMWcEtupgyAe6moOkuEsWN1nxN3tf/u qQiA== 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=s/Q67vMMYuPsjuSK9sLzU1LCeFaWe4xF/l4UFNZMONQ=; b=Y94hmDO8gClYJP+CyfmyEDmBqZsqXn4inLsf2ff8DWnkdVnma05e1iZByRjVn8pqBK 91ridbADfJGUDOL4nIz4yAT4jQ99OD3W2t07Ws2HYZkrqjS5oHc2F9jhpm5wYhGdPbaS HsycdeIGSESEA/dY3/vdnPjdGxiR0nKhF9TpuuZEG63ENlRFE6tvMO25iay0wSSBfH86 lz0JF74JOI4+Czh7wPhm4Z9hN7f1NwKtiODrIvCbSW59G0r+cOkukEhJ0CQMqNoCzGxL 54cKc1FliFYkKD8+pRU6SsXD/YZQxWwCyVJLg0ufIXKKbQMlsfEP7Bg7Hxu6k746Ddpt W6fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=AVLJQflv; 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 s25si4587243ejz.751.2021.01.29.03.56.53; Fri, 29 Jan 2021 03:57:18 -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=AVLJQflv; 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 S232330AbhA2LvS (ORCPT + 99 others); Fri, 29 Jan 2021 06:51:18 -0500 Received: from mx2.suse.de ([195.135.220.15]:52542 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232310AbhA2K0S (ORCPT ); Fri, 29 Jan 2021 05:26:18 -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=1611908593; 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=s/Q67vMMYuPsjuSK9sLzU1LCeFaWe4xF/l4UFNZMONQ=; b=AVLJQflv/+SYkSv4ERXyiT7/jY3GzNjJm97jAboIN3LMwVBbN2x7H/KCFiEihomOMdrfsH gcyRhiH9LkuycXyRf5uQ6UzJ7Ci67vQ0hTzLhrvCsqWvWU3wqQc1iBhmw76ZvSCZGUhLvj 8w0LFU8kORoRU9LyGyyHc/SD3SCCYBo= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 8D1A8AFEC; Fri, 29 Jan 2021 08:23:13 +0000 (UTC) Date: Fri, 29 Jan 2021 09:23:12 +0100 From: Michal Hocko To: James Bottomley Cc: Mike Rapoport , David Hildenbrand , Andrew Morton , Alexander Viro , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Christopher Lameter , Dan Williams , Dave Hansen , Elena Reshetova , "H. Peter Anvin" , Ingo Molnar , "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> <73738cda43236b5ac2714e228af362b67a712f5d.camel@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <73738cda43236b5ac2714e228af362b67a712f5d.camel@linux.ibm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 28-01-21 13:05:02, James Bottomley wrote: > Obviously the API choice could be revisited > but do you have anything to add over the previous discussion, or is > this just to get your access control? Well, access control is certainly one thing which I still believe is missing. But if there is a general agreement that the direct map manipulation is not that critical then this will become much less of a problem of course. It all boils down whether secret memory is a scarce resource. With the existing implementation it really is. It is effectivelly repeating same design errors as hugetlb did. And look now, we have a subtle and convoluted reservation code to track mmap requests and we have a cgroup controller to, guess what, have at least some control over distribution if the preallocated pool. See where am I coming from? If the secret memory is more in line with mlock without any imposed limit (other than available memory) in the end then, sure, using the same access control as mlock sounds reasonable. Btw. if this is really just a more restrictive mlock then is there any reason to not hook this into the existing mlock infrastructure (e.g. MCL_EXCLUSIVE)? Implications would be that direct map would be handled on instantiation/tear down paths, migration would deal with the same (if possible). Other than that it would be mlock like. -- Michal Hocko SUSE Labs