Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2740399pxb; Tue, 24 Aug 2021 06:34:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnLYLf0mpaFFdRWV5A2vvGgLVGWhs09fu6zbEqLBZh9gVfeehXRKjw9JjFNFkp5Z/V0qeD X-Received: by 2002:a6b:8b4b:: with SMTP id n72mr30559095iod.18.1629812086817; Tue, 24 Aug 2021 06:34:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629812086; cv=none; d=google.com; s=arc-20160816; b=InBqDfrByKJ0PGtCyDEJaGjo0vsMkEh+rA16ngw9cu5jzLV7fG8HUCcwqWNc/ghEUj CIYeev1TNe79wNvK64YXhzkwmB/CoqdSGzZMVKKOt/tFFlKASzxoNPwCxObCbkXU7vUT /PjXGjwPEG2BhE2ZygLZBDLEv/3xb9OAaZKx/vjcd2bhotmSnaZv3ajw3ZLjUrekSMlD T5txW9B68j9Ikkqcq71/8Lw+4OZchVtX1S1KIHkv2mqmPkyqhf3bLg7l1AlRfuH07ULB WBLfjaVaEIbkq+YlXVTcDgE7h4ekWDzKGeGIHRaRhmyJ0ZORWEWT+NuaeI+AKBNGsoZC Do6Q== 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=86IOF0wvAQr6un6krbxF9wgJeLGKHNUId9qw7WsWQXQ=; b=uh3+zZHN6vhIgcYVUS0ZOtBkG2smcUV61vnrGDOEigpR59Och9Cz+9vwahhDa2+FI1 XH8t3rminjAwAE++ryzcvbHCtu1+wUpY0+dqdhpzI2w7gQVzS3ACWM9tTmG5OAcrE0j3 XyPae8HFZXKCh8Q4WHfu77tYzAKoda3lVD6ptk88SZFaPYi7yZ6WTcHxVybAAavNxuvM WARcuIMI0nfsc4cHD31wPF5mtHTJtSPINO7NxjIs8/Vd7D2azF5IMdaNvzF2IceClm61 hvpz5t5dlSWHQjICLmvZHllskE6Ykt2YHdsG8SWj7898oZMr/OQxIdGrP+NTOwdyaFJ/ LfEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tyd7XyES; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g2si17210620iob.28.2021.08.24.06.34.35; Tue, 24 Aug 2021 06:34:46 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=tyd7XyES; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237570AbhHXNdu (ORCPT + 99 others); Tue, 24 Aug 2021 09:33:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:60008 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237566AbhHXNdt (ORCPT ); Tue, 24 Aug 2021 09:33:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3C14761027; Tue, 24 Aug 2021 13:33:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629811985; bh=oITe/jUwpv9uwAfzTp34OY4XM2xlLHAdToE8Y67MrUQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tyd7XyESr7DjEar83gnmbRvjvpgtjKFGGW9El2hVGwcTOJm7PPCYwCBTdYVqpYLcm uegptsUdy3DN6rF0zpdTiHNmhVrS016seiuE35uBYGdVcRqRuVCjpbApgrhT2vIg7q 664QU0hkQla59MJa0RAO+wrl8DUcET2sThn4WltEjxUzb9h6Ddr4FnD0lzscDSuDFA U4FiYclmCeTerznuOey4fFD6KoocUb4DSVQqeFkQfHV67k7bNzjg2IdRJcDj6F9CGB OlleWmAPlC4Xs38Tk/cLYilOPFnHodV9bl34kGAgD6f5iDNdceW/e5q7nWqfqVZGff D8O2+TeirN7dw== Date: Tue, 24 Aug 2021 16:32:58 +0300 From: Mike Rapoport To: Dave Hansen Cc: linux-mm@kvack.org, Andrew Morton , Andy Lutomirski , Dave Hansen , Ira Weiny , Kees Cook , Mike Rapoport , Peter Zijlstra , Rick Edgecombe , Vlastimil Babka , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 4/4] x86/mm: write protect (most) page tables Message-ID: References: <20210823132513.15836-1-rppt@kernel.org> <20210823132513.15836-5-rppt@kernel.org> <1cccc2b6-8b5b-4aee-483d-f10e64a248a5@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1cccc2b6-8b5b-4aee-483d-f10e64a248a5@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 23, 2021 at 04:50:10PM -0700, Dave Hansen wrote: > On 8/23/21 6:25 AM, Mike Rapoport wrote: > > I'm also cringing a bit at hacking this into the page allocator. A > *lot* of what you're trying to do with getting large allocations out and > splitting them up is done very well today by the slab allocators. It > might take some rearrangement of 'struct page' metadata to be more slab > friendly, but it does seem like a close enough fit to warrant investigating. I did this at the page allocator level in a hope that (1) it would be possible to use such cache for allocations if different orders and (2) having a global cache of unmapped pages will utilize memory more efficiently and will reduce direct map fragmentation. And slab allocators may be the users of the cache at page allocator level. For the single use case of page tables, slabs may work, but in more general case I don't see them as a good fit. I'll take a closer look to using slab anyway, maybe it'll work out. -- Sincerely yours, Mike.