Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2632764rwd; Fri, 19 May 2023 08:12:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ41ANnKaaBMvMYRxOWw+589+ID03CsbmbeC7gsfXYM+RY9q2iztX33G5styyrfnF5SpeYKy X-Received: by 2002:a05:6a21:300a:b0:105:c74:6a4b with SMTP id yd10-20020a056a21300a00b001050c746a4bmr1697038pzb.57.1684509177561; Fri, 19 May 2023 08:12:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684509177; cv=none; d=google.com; s=arc-20160816; b=By403FncPIM0UVGIIgO0EI1En5b6g5vY3SX9z5RxLB/3df1aOaabVgLoeVMoNH2D0d LSCtrBPgLIhRS1MP52gkNiovdK4gFNrfGQlapjZd4ZyiCRVIJGMYUA33Cf7P/4DgOWpC 4EsP8cFL/3bl5G+7lVQGxRb840xVRHvem/HO10ENif+eInY+w7CrmFjAbjfdir9Tfv/2 loZqS0rRL8KtT8Aw58C1JxGXNDmtzIo57AQBnco2JjXly7oIb9hNd3EmFdidpKFbrqyq xsOjeY6fag6PEH1HaxUXgg6tEsOelosBoZoiUTnwy7m0MZyxDhHoUcKSnlLt2suLP9PW a61w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=rDLgLUJ0rrmB/7UJshPY5Np0IALAi+sq2a59vSquYrM=; b=BNsRnGT9AhXP+yKpAvn0atFz9ftqRh97IFQbzpXHzjkztFYHDYVSt1M/1mEeGzsD6Z 9B7CYfzxCs+2jVLXVpB5wT06SldINmGGaH0Yz6KQXECaJpZ2plfoQgxq3v0csNYu1WPB mf3QLz/75B7Dj9jQBq5ccvDGodVvEtXP0sY288ooleu4uKsOmR2z5jKtD9EJWvvuxOP0 VwNTty9EDIdjzzfEvKZDCI5PK5cn9iU8MktkEnSIgWgn8KoDc7PckTqL4Z6dVPOdhnTO 0GCP9LSo/+eHLhE5Tq0WxlCZkfA3EENxesEGsOoz2VToTlVG72Her2INz/H5dGUzDyqZ gi+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XwtGzrle; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j22-20020a633c16000000b0050bf5b9ad11si1928643pga.752.2023.05.19.08.12.05; Fri, 19 May 2023 08:12:57 -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=@kernel.org header.s=k20201202 header.b=XwtGzrle; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232225AbjESPJO (ORCPT + 99 others); Fri, 19 May 2023 11:09:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232196AbjESPJM (ORCPT ); Fri, 19 May 2023 11:09:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93C00121 for ; Fri, 19 May 2023 08:09:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3A3DB6587F for ; Fri, 19 May 2023 15:09:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D82DC433AA for ; Fri, 19 May 2023 15:09:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684508948; bh=rDLgLUJ0rrmB/7UJshPY5Np0IALAi+sq2a59vSquYrM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=XwtGzrlehOHApxGNhTJs7uj3zzus/T/qulGrC436Io2KRBxHmBrifjbaz4joKgfVa t9Kj0/dQiDzIlb1sQKd9sQ4ac/gNMK96DS78eVtxKVUwdZBY0lQz8rCTqDNx1ljLCn bFD1c0xwaQc+oOE+hNCC/NQFoQv7alZRj1MZnN3PB7dGKjy6Tt4CoQZpovflYHFYkX 45zZZPMyn/s88NmUsluCQPyO7sVqVB4jC9LMVXIpl3ExRhepi8Ckx9qWStHFoE+N60 PddB1nTcBq+ECU5Sdp456AJMpfRJx79qKNxqWDc0Hd127uKHIGAyFyfiO+XUQPQn/r mb2+JnUgaT+Cw== Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-2af2602848aso7693791fa.2 for ; Fri, 19 May 2023 08:09:08 -0700 (PDT) X-Gm-Message-State: AC+VfDxb63hqxZftVuWKexAKUL1Hx/KfSuu6fF05pM14jpmok2xUIyGg iUGg9psPJa+xjw4raDhUPwVdyVuLlaR8bhfoj+s= X-Received: by 2002:a2e:8845:0:b0:2af:228a:a277 with SMTP id z5-20020a2e8845000000b002af228aa277mr1174433ljj.21.1684508946420; Fri, 19 May 2023 08:09:06 -0700 (PDT) MIME-Version: 1.0 References: <20230518152354.GD4967@kernel.org> In-Reply-To: From: Song Liu Date: Fri, 19 May 2023 08:08:54 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 1/5] mm: intorduce __GFP_UNMAPPED and unmapped_alloc() To: Kent Overstreet 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Thu, May 18, 2023 at 6:24=E2=80=AFPM Kent Overstreet wrote: > > 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 th= en > > use it for many small allocations. IIUC, buddy allocator will use unall= ocated > > 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. Thanks for the correction. Song > > That's also why I went with the bitmap for my slab allocator; standard > kernel slab allocator stores a freelist ptr in free objects.