Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1441384rwd; Thu, 18 May 2023 12:01:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6xHyf2HLzOzD44Qt243OXnZFwR6ISmu5AlOhnPt1sFQO+/4D6LH0AdqOWnjeyE4D/GhnYh X-Received: by 2002:a17:902:ce8a:b0:19e:4bc3:b1ef with SMTP id f10-20020a170902ce8a00b0019e4bc3b1efmr3695458plg.64.1684436506516; Thu, 18 May 2023 12:01:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684436506; cv=none; d=google.com; s=arc-20160816; b=tztJkrSxbYld5XZfX8YA4C/jHgK8JV0u4J7FcTCu0Qq8jzKHNLQdEt/VPGLyrdDEXI 7CLQvZL3oJHxHEUnSsiBihkAlQDFhMXZAuC/E55s3az7l3jWdDHeeWdmQehj5BpCqAQP YcK0m0YRzJA0PNjPxhpNJYXFbbIKXoNrd71/A34Xg/cDXErv5TS3/YDHMkC9XVWOsKG2 pYbD0TB81EoKrJX4inqF3OxCL5RPt/6fJhIcnQUu6UEOBeibLPwljJtwwkYlLJGLDaDY FAgyXlNznugTJJLyu9uBC5picf60uHhXw3uXG0lKUNeW3odIMkghngJjjh363oTe31Ln QPgQ== 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=iYxZosG8BtOYrGXh59PzQU54VXNPopHL75vY+dwiVcM=; b=m13QB7wGZJ9nO36MGt8IWUpOsV7eie7IoTlTvgBNItOOjnCFM0KLkddJsAzZpr9FI6 q6yBVpkbuc/G2WcqpeHjStIxNxmUL45t+YPrYl6tqp3pZGs8XGb2jbAHu9+EiSLn7HrA 2E3BZv6b/BR4ZwQyoSND8D0jlWHOY+cgFuKTiPfBRcYEzwxIYUJZqgslgElOtpRPiUj8 Hp0N4OkugSaM2WmjlYXuRdwWkwWnkvUXtb/g5H3yQ/lsYmdnT+e1NjZADiCqEYHgbMxD wPzwTlULXMa1RstuVn/zNUkZtNxcgdoxPg0CsjrFzGkVWvKL89wk71YM4R4MqZ/S9LQF 7RNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OD5NrdHw; 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 u191-20020a6385c8000000b005348885119asi58890pgd.523.2023.05.18.12.01.33; Thu, 18 May 2023 12:01:46 -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=OD5NrdHw; 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 S229832AbjERSyk (ORCPT + 99 others); Thu, 18 May 2023 14:54:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbjERSyj (ORCPT ); Thu, 18 May 2023 14:54:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F538E52 for ; Thu, 18 May 2023 11:54:38 -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 2BB0A61B56 for ; Thu, 18 May 2023 18:54:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E8CDC4339B for ; Thu, 18 May 2023 18:54:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684436077; bh=tSeHM2j6YYE6eQ0ZjDsz94w5GR3l8DavaTLlPbhc2J8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=OD5NrdHwvEf3BnD5mg99CS/15uplK/QF3paQ9C+SLkCMRtmw0TcqQqyWN/sgsntT+ Wf9gA6IhsBCoqvaqSTP+oxD51l+ATZ+rp0zdNk0O/LJeMDB6SZS7Z4chIihHq/R5zr XqlT2s8Y67+wQhbNPC+GLRPPTc7V7qcp8NuYB+d4nczWXY4k2y+8TOTUtTczbuJz00 d14rRtP+sqZa1dOW4IV5WpVY45+04HWhVv5QQBPD9ErtrZ7zNGwCO4aVQ7LdjyvRH6 oEGWp8eJOiYQuE1QEMp3f0bXe4ar88F2Q8ZGkaDLnPCW+t2rtxERYwF7qyl40A6HIi eniMRMbgArPPg== Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-4eed764a10cso2868982e87.0 for ; Thu, 18 May 2023 11:54:37 -0700 (PDT) X-Gm-Message-State: AC+VfDxIxCfpa6T+TGmfEe8UP1AyH10gZXdmP1xVM3SpE6TLLOCASpEq z6BDtkY7mnyZkjrEAVlyGG0oyQw9o7QRkqg77yc= X-Received: by 2002:ac2:5315:0:b0:4f2:6817:2379 with SMTP id c21-20020ac25315000000b004f268172379mr62228lfh.23.1684436075613; Thu, 18 May 2023 11:54:35 -0700 (PDT) MIME-Version: 1.0 References: <20230308094106.227365-1-rppt@kernel.org> <20230308094106.227365-2-rppt@kernel.org> <20230518152354.GD4967@kernel.org> In-Reply-To: From: Song Liu Date: Thu, 18 May 2023 11:54:23 -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=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 10:25=E2=80=AFAM Kent Overstreet wrote: > > On Thu, May 18, 2023 at 10:15:59AM -0700, Song Liu wrote: > > On Thu, May 18, 2023 at 9:58=E2=80=AFAM Kent Overstreet > > wrote: > > > > > > On Thu, May 18, 2023 at 09:33:20AM -0700, Song Liu wrote: > > > > I am working on patches based on the discussion in [1]. I am planni= ng to > > > > send v1 for review in a week or so. > > > > > > For reference, here's my own (early, but functioning :) slab allocato= r: > > > > > > Look forward to comparing! > > > > This looks similar to the bpf_prog_pack allocator we use for BPF at the > > moment. (search for bpf_prog_pack in kernel/bpf/core.c). I guess we > > can also use bpf_prog_pack for bcachefs for now. > > The code in bpf/core.c does a _lot_, my preference would be to split > that up and refactor the bpf code to use something generic :) The code is actually splitted into two parts: bpf_prog_pack_[alloc|free] vs. bpf_jit_binary_pack_[alloc|free]. The latter has logic just for BPF. But the former can be reused by other users (maybe with a little refactoring). Once the vmap_area based solution is committed, we will replace the former with the new allocator. Thanks, Song