Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5829370pxb; Mon, 14 Feb 2022 08:32:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJwinlrlILRtDyYJNGhBJkQ0ICu5OBOul4S2NezOhO/hE4TQP8ij6QrG9f0iye+bp08A6sBF X-Received: by 2002:a17:907:62a0:: with SMTP id nd32mr357741ejc.96.1644856374804; Mon, 14 Feb 2022 08:32:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644856374; cv=none; d=google.com; s=arc-20160816; b=yZMoBpMczuNs/8lXZOWf8kNib8SDvWRbpuiuaKdpE7OaXu8y+zLFn8gwUINrQrAl9b w+uMjfdz6dBbKt3vs1khTxeNZYSfm0p3I+zHxD7zaCdAQOtXiXoZPC+npCgWNDei60AZ puwBgjESX9hj+Qesy1JgwLnX5HgVDNZj3vf4hqIB/BP/WlUYIaZzgJ13bnyJhMezfdXZ zLSIGCN/7baqU6Rd3gv4uZxYzQ6yjc0vyS8QJUKFa1+5NVlFi+VXaoKfjBDyZ6wreLBu MC6FojrSK62M7K73xmxNaMH22Sj5ZkkaYXA1zQpRTgNGMaGzepVK1TU2E77po2RlpF0N rr9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=0S222rJiXMXdLbL4sr8eXv1/RjuJqY7+BlIpDb0kXQU=; b=jqWIx3VmejrYyq4jn+VHA7gMdhdkCbIu5CQXfHBHGT6nJAgky9+to1CA5iFQEihZQh EC+jM6eq1X88dSib0I47mRQ/diK2d0antCdOpnn3KSW9kLWOmhEfDSID0rA9Bt+zT9af 5bFPJIttRdZTOuX7FZTzLIwdMRB/26gicxKffciDQAQsgwE0Qew0ogKuud5hEux1b+Ko QjG/red0iVtNoXhm6E2nGz/J/aH0cX1uITPmSBmo59E2SZXLrTH4NgJ4clSEHIpt8WFJ Y+BBXHYIPssl3Yt4d9dXF+Xvtc1/wZc7rAFFC9iw/kv/DsyWVT+eL11Lo70DmBQPnDN2 x1RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Y1grS4Vl; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k21si5257737edq.386.2022.02.14.08.32.31; Mon, 14 Feb 2022 08:32:54 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=Y1grS4Vl; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244465AbiBNNhQ (ORCPT + 99 others); Mon, 14 Feb 2022 08:37:16 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:50104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239718AbiBNNhP (ORCPT ); Mon, 14 Feb 2022 08:37:15 -0500 Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD93949F92; Mon, 14 Feb 2022 05:37:07 -0800 (PST) Received: by mail-il1-x136.google.com with SMTP id n5so12302982ilk.12; Mon, 14 Feb 2022 05:37:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0S222rJiXMXdLbL4sr8eXv1/RjuJqY7+BlIpDb0kXQU=; b=Y1grS4VlTpVrHPRcg3ogv2eoxW96xGbuQ0rNH+3v401Jh/WkzItBEU6E8rfh+flaDN 5gAMiLYQUE0lQEqhJ9TeDJNcTKUlat+WvO0QuhzGZfLG0+4Y2EQTNNhisaoNrUeshGve /x0TTqGyLkY5CsZNkDvwejmmP9NX3qgHvTxWYaVXI+KWRfPR2uhIN8/ZiiT83TcNtcmY v1/u9il5hn12+4yKYW+rONaHHhdGAmZxWBuoa9rsm8oC1YU76D89FFKtZbIrCRowcCzo XrYaqiY/pjg0nkJp2xIAvKQ2BmvohlmqPifRnaz/jTW79L592OvQvLTELRaIarOO9+gG En4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0S222rJiXMXdLbL4sr8eXv1/RjuJqY7+BlIpDb0kXQU=; b=cFXV5Ne9tBw2OwSQbyrV+OSQ7TOHvpNVBAhFPNNUIB4rnPx4Y5StodHuc3DRTDNDq2 EkbUl9CYfxXbsE1CVtppnfhyGiiPXvaZ6w4hCm2Psys0MqOMdHmwJjzG873LbjLrgNq5 m0gKoGNu3vKmEiNaZaBn9bkkywVx0fqZ1qdMM4tPe2IBse6fqjTmMGag3dcjiIJ9EnvB 2d6LZ2MndBVbfpayAXa/o38ZlAqH35AZAGWZPYIuKCfP1wBbUHSOHG0KWmdV+ADTV6GO tWFcsz28z8WVsxBhx4gK7PBapMWhlmBFI9QQYEPQHjkEj6ozNWsR5y5bKQ5Znj4x3r14 M5gw== X-Gm-Message-State: AOAM530Rg/kk+RjUz2FdRKFDp47rlaK1UWsfzsXijHKelCVGE9J405tX X0mkbJfsMH68QeS7Xt9+htDF+MemvOEYXpmrnG4= X-Received: by 2002:a05:6e02:1ba2:: with SMTP id n2mr8403067ili.5.1644845827109; Mon, 14 Feb 2022 05:37:07 -0800 (PST) MIME-Version: 1.0 References: <20220212130410.6901-1-ojeda@kernel.org> <20220212130410.6901-11-ojeda@kernel.org> In-Reply-To: From: Miguel Ojeda Date: Mon, 14 Feb 2022 14:36:56 +0100 Message-ID: Subject: Re: [PATCH v4 10/20] rust: add `kernel` crate To: Sergey Senozhatsky Cc: Miguel Ojeda , Linus Torvalds , Greg Kroah-Hartman , rust-for-linux , linux-kernel , Wedson Almeida Filho , Alex Gaynor , Geoffrey Thomas , Finn Behrens , Adam Bratschi-Kaye , Michael Ellerman , Sumera Priyadarsini , Sven Van Asbroeck , Gary Guo , Boris-Chengbiao Zhou , Boqun Feng , Fox Chen , Dan Robertson , Viktor Garske , Dariusz Sosnowski , =?UTF-8?Q?L=C3=A9o_Lanteri_Thauvin?= , Niklas Mohrin , Gioh Kim , Daniel Xu , Milan Landaverde , Morgan Bartlett , Maciej Falkowski , Jiapeng Chong , Petr Mladek , Steven Rostedt , John Ogness Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 Hi Sergey, On Mon, Feb 14, 2022 at 6:27 AM Sergey Senozhatsky wrote: > > Is this flexible enough? Why not let user pass bindings::GFP_* bitmask, > just like what the underlying kernel API does. For particular kernel abstractions, they may know what they need; but in general, yeah, we may need to allow for flexibility where needed (see the `TODO` comment in the quoted code). For collections that need to allocate, it is an open question how Rust will handle it upstream, as there are several approaches (if you want to take a look, see the `allocator_api` feature and the working group at https://github.com/rust-lang/wg-allocators). But in order to be able to experiment and see what is best for the kernel, we have an in-tree fork of the `alloc` standard library crate (see `rust/alloc/README.md`). Cheers, Miguel