From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DAFF7C7EE29 for ; Fri, 19 May 2023 01:24:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229828AbjESBYl (ORCPT ); Thu, 18 May 2023 21:24:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbjESBYj (ORCPT ); Thu, 18 May 2023 21:24:39 -0400 Received: from out-25.mta1.migadu.com (out-25.mta1.migadu.com [IPv6:2001:41d0:203:375::19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F61899 for ; Thu, 18 May 2023 18:24:38 -0700 (PDT) Date: Thu, 18 May 2023 21:24:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1684459475; 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=CxkuaiRuEcb1M9z9WtlkE7aQYUGvPRKev/aoddhrhbo=; b=JT/aBHaHjFl2Dp02kpXdGkoH1gI+ffXh3WrzhxdRImncKNfVqjq/9MGQAuevdHmheu4sW1 WU36TUKiPVnJhzQ99pQz9s5O6FqPCPsmxydT591Bbof8JzxMKks3CJKP9bZUcJYsmafilR co2szWS28R7lML9AcPulGFRoBFIGKqc= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Song Liu Cc: Mike Rapoport , linux-mm@kvack.org, Andrew Morton , Dave Hansen , Peter Zijlstra , Rick Edgecombe , 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: <20230518152354.GD4967@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 18, 2023 at 01:51:08PM -0700, Song Liu wrote: > To allocate memory for text, we will allocate 2MiB, make it ROX, and then > use it for many small allocations. IIUC, buddy allocator will use unallocated > parts of this page for metadata. I guess this may be a problem, as the > whole page is ROX now, and we have to use text_poke to write to it. The standard kernel buddy allocator does _not_ store anything in the page itself - because the page might be a highmem page. That's also why I went with the bitmap for my slab allocator; standard kernel slab allocator stores a freelist ptr in free objects.