Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1822018rwd; Thu, 18 May 2023 18:39:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ZqWKbqNKn3rX7BW54uxemon3Txdd0JdyU7KJruFgRH1YUiDv/dltz/JzZmOjjIw5BqnMM X-Received: by 2002:a17:90b:30d6:b0:24b:be0c:6134 with SMTP id hi22-20020a17090b30d600b0024bbe0c6134mr457239pjb.33.1684460356742; Thu, 18 May 2023 18:39:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684460356; cv=none; d=google.com; s=arc-20160816; b=tjRwqXuVN1LGmRGiAkfYJ7d/nJEcRKmKvpuSf1egcyTnNeIWfptDQFkkX3hso4sZ/q 1HIFvzf2ZPmyVw6NgY+ivoLMvHHbVdYpxHOVUvFt17sZxvVcKgZr54fNrAfX4nCvIqaP aKTr4pJoXchBbfLjr5jZN0+EcNTrLwIX0khipzUmRZ9rLGKGm/g/k+ZvmC+B/+RWdcST GYXorkZNmhe6RD4ZWesFmY6gy2R6nfVG1xOKxMe4XioCGgkz8V/eyDoFreHS9UegQegY PPQ+ao7k81EYWRgJS3B1SHMUlSDFfZnC2C3WAu7jxcpCSQhmQ+S57ER9fPzbRDsUsP0y tWwQ== 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=CxkuaiRuEcb1M9z9WtlkE7aQYUGvPRKev/aoddhrhbo=; b=kFY9nQwuogOLYqD9vHoyUwUQ/5DTy22s9w3zAAMt7Og/3N9UmNPCnijyFWpnTv1mTl XXVkh7ITeKGWqJeyqQOhzNOD0h6PtJzbvU4A7h9bRE1AMHG/OtIq+E/UUDzeiOSJXc2+ hgabkUKPn3wqPeHfaFlkt7J8ac/v8PuA79Of0BLI76fhNzs0+0AgneOX9ISLYp5NB2nH wAR2SVQaLHUmi8lJZFwnRzSRjBd2U7fZRRLAf5tmFE8u3t+j1/wF1AQzjytPSXGVkhlm aabGk2CZqWvh0DrldL73r3FAq/YnlBDCreoXPC7ExVgBGWOINrLpu+KAOdYLDPO5Wb0g Y+YQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="JT/aBHaH"; 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 f6-20020a17090ace0600b0024df4dae398si758880pju.18.2023.05.18.18.39.02; Thu, 18 May 2023 18:39:16 -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="JT/aBHaH"; 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 S229635AbjESBYl (ORCPT + 99 others); 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 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,URIBL_BLOCKED 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 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.