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 02E1BC77B7A for ; Fri, 19 May 2023 15:09:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232179AbjESPJP (ORCPT ); Fri, 19 May 2023 11:09:15 -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-Google-Smtp-Source: ACHHUZ5ITafro9iwmTU6vR/smLxeVBItH3Onrt90yV7r9RdUM8xsIZj5uBIiwP+QRe9z/Lw0esi3rIVYclGXiVS2V20= 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 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.