Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp388674rwd; Wed, 17 May 2023 20:50:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4pjVbA7CR+M6/gfnKYEl6jEqEdQQl7qBZ2CT6D6FVBqCBH6mhRFfx8u9NPI71NxNk5liaR X-Received: by 2002:a05:6a20:3c9f:b0:103:90ab:d79 with SMTP id b31-20020a056a203c9f00b0010390ab0d79mr828159pzj.25.1684381806960; Wed, 17 May 2023 20:50:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684381806; cv=none; d=google.com; s=arc-20160816; b=OBp5uHHy72OyIFCEsj3U5jh/ev19rTQbu5Sq5SRhUnSHLdJPApgNXgbggqypxB4tuG VSgK3jU4HxyaYtfLAeq4CMScv5hfQidaoCmseatbECWmJDXs7oBfxUnema7qITF/taEr LaG9ITA9WjMAHXqfgj6etNY3OBU6l3/24lXPZC5qI59TYyD4axXIfpx5hXm1qTamMp3h InyzH8ou2OXq73qvREO8GbLWoaeB5zfkIJV/o3N7BkiBDK/41BCXuj7cmX4nPic01gKZ uioDe9OqsaD4JFZNBSSHBLM45La174j184IXfSGdPajUrL44FPHqfdLN0FyaqhE9v+ch Glew== 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:dkim-signature:date; bh=R/xSxkO34rTHB5jgYq+EIG5zjckP6E+hsO+vx3uRhUA=; b=03YV2PHm4NU+SHXyZB8UuGurw2fzVElB6zw6kWdzIJTdZdTv0re0MYeSeuQabuYDp6 9T/uilOy2QbaSJdK4SbLma7e/g1iXW2lExhPfmMi9HJEfRX5zx2cgauflvE0b3vTLU9B XY46hIiVGvY96ubKDHOjdweGqKrorgvSStxG2TxCRc5B6nm+eDDaD0EDg9keEJkC5/Tv gx8TUVlwuq0wOYJVnXsROUwPPiPU3xUes+1QGfbR262gLCDQFOrWy49HZVy1OdGCsVkj C+ByhYB3tR/InULM+7ePVzx4mt7TFA1KkPfkj1EkLyCjut9yWx30YDx8dnJWf/98yU3y 723A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=kYDZkSKo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i130-20020a639d88000000b005346ce7709bsi430978pgd.294.2023.05.17.20.49.54; Wed, 17 May 2023 20:50:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=kYDZkSKo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229814AbjERDgK (ORCPT + 99 others); Wed, 17 May 2023 23:36:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229500AbjERDgH (ORCPT ); Wed, 17 May 2023 23:36:07 -0400 Received: from out-2.mta0.migadu.com (out-2.mta0.migadu.com [IPv6:2001:41d0:1004:224b::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC92D30E6 for ; Wed, 17 May 2023 20:36:03 -0700 (PDT) Date: Wed, 17 May 2023 23:35:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1684380961; h=from:from:reply-to:subject:subject: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=R/xSxkO34rTHB5jgYq+EIG5zjckP6E+hsO+vx3uRhUA=; b=kYDZkSKo3Vd+Vlz3v1TqKnv5UZZxWD+B7u0uWz6Dkfqr9ZyJBFtS6MByThfEB+n4utJGLM rNGCmqvF4gzQQHhf299ssyn7P7e2uN7wJt5+ZNmfgQshSe4hzV+RJ++vjONiskQT+QYUZt XF9WSVQIfHOOCRmlRkgYsI2hqFoVZfo= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Mike Rapoport Cc: linux-mm@kvack.org, Andrew Morton , Dave Hansen , Peter Zijlstra , Rick Edgecombe , Song Liu , Thomas Gleixner , Vlastimil Babka , linux-kernel@vger.kernel.org, x86@kernel.org Subject: Re: [RFC PATCH 1/5] mm: intorduce __GFP_UNMAPPED and unmapped_alloc() Message-ID: References: <20230308094106.227365-1-rppt@kernel.org> <20230308094106.227365-2-rppt@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230308094106.227365-2-rppt@kernel.org> X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 08, 2023 at 11:41:02AM +0200, Mike Rapoport wrote: > From: "Mike Rapoport (IBM)" > > When set_memory or set_direct_map APIs used to change attribute or > permissions for chunks of several pages, the large PMD that maps these > pages in the direct map must be split. Fragmenting the direct map in such > manner causes TLB pressure and, eventually, performance degradation. > > To avoid excessive direct map fragmentation, add ability to allocate > "unmapped" pages with __GFP_UNMAPPED flag that will cause removal of the > allocated pages from the direct map and use a cache of the unmapped pages. > > This cache is replenished with higher order pages with preference for > PMD_SIZE pages when possible so that there will be fewer splits of large > pages in the direct map. > > The cache is implemented as a buddy allocator, so it can serve high order > allocations of unmapped pages. So I'm late to this discussion, I stumbled in because of my own run in with executable memory allocation. I understand that post LSF this patchset seems to not be going anywhere, but OTOH there's also been a desire for better executable memory allocation; as noted by tglx and elsewhere, there _is_ a definite performance impact on page size with kernel text - I've seen numbers in the multiple single digit percentage range in the past. This patchset does seem to me to be roughly the right approach for that, and coupled with the slab allocator for sub-page sized allocations it seems there's the potential for getting a nice interface that spans the full range of allocation sizes, from small bpf/trampoline allocations up to modules. Is this patchset worth reviving/continuing with? Was it really just the needed module refactoring that was the blocker?