Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp474834lqb; Thu, 14 Mar 2024 17:51:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWh9CQvPMA5aNbgFiLtiO1AaXoXVGtwXpUlGGqOr5dPy8vtPbbddmZMOjj5c4GCvOKnVqzPalw8Ibpz6VD66P0b19sVXOGcm96D3tNMqA== X-Google-Smtp-Source: AGHT+IEr+rxlcy+gieH6e8i7+sHxX0rrpUQUBYCUYoORCYRdBCT763qgTTUAfDBLG9ZnsFQeKZuY X-Received: by 2002:a05:622a:104d:b0:42f:2009:17fb with SMTP id f13-20020a05622a104d00b0042f200917fbmr3816086qte.34.1710463874859; Thu, 14 Mar 2024 17:51:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710463874; cv=pass; d=google.com; s=arc-20160816; b=Ugiw0XLM1uMwo0glo6ovkvlrmUt8aJsFNhs4ObepSBUrzrhA5pwSPg/iOM+KChxAVy KTv/VcP+bTlYTJOm0sQNJPg3e74/yYMJ3q3IAwbYq1IZlfd9wxgj4FuRrZ8BXpXDfnVL 4+QbtgEZcRAxYrcWKUtNVjdy/RIoR+L2neCAN1P6yiFdvIoQ7WyN7bWqHOtyA5xm4UaQ ejTc6NldF2xppbAUlJGz0kO9GLSqQArY7wF6UYPXWYaBN4aBkJ2tUgjnISPrMUNZNjQS VzW6Lh3FBM+4t5xJ8C3iJoe8FTipXFXMyzlumPz/p5T3HbJA5+Xf0UAtik6gyQ7fT9wU dcLA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:dkim-signature; bh=onEktwJBHB2eXNJMOcrh4ORRowNVQ4kkEBJ7zXW9BpA=; fh=BezMiPkDnyqq+n4f22vtKDYrKSORmWHaTPjMGQumt9Q=; b=KWaBsaBDj+SDGEtbx2CFDMSTxhLrhzb4mL1r2TGtKtQkhBkYv5H9sALhdxK+T71dt9 e9WZ0sAwmbUsCFINKzQ/qU0eJpWX3gaOb9bUjbetG9hbcfpsSzyw3N2+LV5myJLiA/2c aoH1VrCZme1IX3RNJNuG+ig3r3Ion7Txr4do9c7L+DcrV7nPYqcEzsT6LeGTqggoTK9h Q0ugpDyRy+TA4JvU/eEb7SZdru3fCEj234pSmGsI+HLRhsKOTnQsA4qSuNbGKbyoJipr 86/L5RG8g26ANP7WM7QF8oJSRezX8PDp77ElEQ/KaNphUnhPVzjMUXb6vHmgGHKIymQn DhTQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@metaspace-dk.20230601.gappssmtp.com header.s=20230601 header.b=oelIcVXH; arc=pass (i=1 dkim=pass dkdomain=metaspace-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-103734-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103734-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id g18-20020ac85812000000b00430b084c64bsi350650qtg.108.2024.03.14.17.51.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 17:51:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-103734-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@metaspace-dk.20230601.gappssmtp.com header.s=20230601 header.b=oelIcVXH; arc=pass (i=1 dkim=pass dkdomain=metaspace-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-103734-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103734-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6D0B61C21993 for ; Thu, 14 Mar 2024 19:41:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 462547602C; Thu, 14 Mar 2024 19:41:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=metaspace-dk.20230601.gappssmtp.com header.i=@metaspace-dk.20230601.gappssmtp.com header.b="oelIcVXH" Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 975CA757F5 for ; Thu, 14 Mar 2024 19:41:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710445283; cv=none; b=NVgEWLt8fKir9zyCUIq36UvlCF0xoSHfipTm36IcsyH5oSrx8kjaFcfLutHp84yn0LScuTViykGUkBjlspKZv9bLsm54fgi0qPBE/t8jPsQdHDUbW1eLgQk0wKQ+MBsEJPTTyTk0Ffo7QHG1Z4e4lA8aFkBnH59hhxpMh0O66wU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710445283; c=relaxed/simple; bh=onEktwJBHB2eXNJMOcrh4ORRowNVQ4kkEBJ7zXW9BpA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=cf2zSVs/6aGubUaOgz4bmNqZdjzjjUEgbDPEY6iCJpOLLyE5SIq10Ov5IIVSTVYmj55KBa6M3mRmzI+WTzK7Y91nG4UBJD/5U35Co2q/KrylwislpNLkeXMGgXy4ZfcF5Dd6+9inWQvpWzjWKMXyLNTByOF2+/HtiyVEzMaaOfU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=metaspace.dk; spf=none smtp.mailfrom=metaspace.dk; dkim=pass (2048-bit key) header.d=metaspace-dk.20230601.gappssmtp.com header.i=@metaspace-dk.20230601.gappssmtp.com header.b=oelIcVXH; arc=none smtp.client-ip=209.85.218.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=metaspace.dk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=metaspace.dk Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-a46692ec303so186120966b.1 for ; Thu, 14 Mar 2024 12:41:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=metaspace-dk.20230601.gappssmtp.com; s=20230601; t=1710445279; x=1711050079; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=onEktwJBHB2eXNJMOcrh4ORRowNVQ4kkEBJ7zXW9BpA=; b=oelIcVXHmAxAgJy++hRkxCKVyUb5JZiFiSwX6PT+K54sa6aWdq6+QmNCPY2vjzOxVB BImHM41VK05Bc3zhxrNYknDQNjth5ZliXoGozxhwA59IZSy1CBuAR6XYnT7CT2fL6jCM V3sbwrtJ5Z5NJ1KIhyEzbilcM0EBtXbCAV5/BEsvzGnPk9W0bqSGRIVyJT5+dQEf+00D d2X/8F/SqKPztERzQ2A8CndAXCWMcPcHc+R54eaVrRYaFCvtXsPNio9ENcThnMzTmhY+ /9E8VctpEGb384dNrS242BoPCBSlkHE61f/8fB6eO7PPZS/KhTt2IfJ9T4KT7A5fjmmg mMuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710445279; x=1711050079; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=onEktwJBHB2eXNJMOcrh4ORRowNVQ4kkEBJ7zXW9BpA=; b=hkBrPoXbI3+e1ljQkBCYz+x7G7+XMqjcoYmG6Uf7z21IT4f6jQqk+sAaC8kEpYRajf VMdgJUGiI17BTlYQ1VhD18VjEbxTOESdSPbvSA4UmMSr/dfbDEbBFVDw5P2XfjxzCA0e ZeBDeY2lLC63t/V95Wj6mksRFL6EM0mVRYXAlhIgcgr2dvBYF7s+v+5A6sSGBQlGV4bU Snjs1WpuKL5QHXZyV5IH3qkeLqA/L05+VHkEiKNAlTQeeeiswGE4fE+ZuxdaHJSMtbhu agbtU4jRtfwjUrlhPVCC4WdUepFbWJdgGh3m/dHgBw3RvKs4TmaqADo7OLBSJ/++QS50 5flg== X-Forwarded-Encrypted: i=1; AJvYcCUTGmiDO7Csij3jxm1xgYVjUrFST0a3+BlNxPVVqcy5I/NBzOSmGOlHe6/4kotI+F4KyioTZRTDIfrn5ObDBpGFvWx0X+1PzJgshrbj X-Gm-Message-State: AOJu0YwNUSRHZUwJxnPQ/twr93urJ7decCBo592FU5YrGcKmPpspvfPj mlluidOs+SsgbcMf3udEJXxtAyTARiUxdMNIsxnd620JmsnLnb2yRA/Swp2uZ0Q= X-Received: by 2002:a17:906:c0cc:b0:a46:2100:da56 with SMTP id bn12-20020a170906c0cc00b00a462100da56mr1804417ejb.55.1710445278810; Thu, 14 Mar 2024 12:41:18 -0700 (PDT) Received: from localhost ([79.142.230.34]) by smtp.gmail.com with ESMTPSA id o11-20020a1709061b0b00b00a3fb9f1f10csm972383ejg.161.2024.03.14.12.41.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 12:41:18 -0700 (PDT) From: Andreas Hindborg To: Miguel Ojeda Cc: Boqun Feng , Jens Axboe , Christoph Hellwig , Keith Busch , Damien Le Moal , Bart Van Assche , Hannes Reinecke , "linux-block@vger.kernel.org" , Andreas Hindborg , Wedson Almeida Filho , Niklas Cassel , Greg KH , Matthew Wilcox , Miguel Ojeda , Alex Gaynor , Gary Guo , =?utf-8?Q?Bj=C3=B6rn?= Roy Baron , Benno Lossin , Alice Ryhl , Chaitanya Kulkarni , Luis Chamberlain , Yexuan Yang <1182282462@bupt.edu.cn>, Sergio =?utf-8?Q?Gonz=C3=A1lez?= Collado , Joel Granados , "Pankaj Raghav (Samsung)" , Daniel Gomez , open list , "rust-for-linux@vger.kernel.org" , "lsf-pc@lists.linux-foundation.org" , "gost.dev@samsung.com" Subject: Re: [RFC PATCH 1/5] rust: block: introduce `kernel::block::mq` module In-Reply-To: <87plvwsjn5.fsf@metaspace.dk> (Andreas Hindborg's message of "Thu, 14 Mar 2024 20:22:54 +0100") References: <20240313110515.70088-1-nmi@metaspace.dk> <20240313110515.70088-2-nmi@metaspace.dk> <87il1ptck0.fsf@metaspace.dk> <87plvwsjn5.fsf@metaspace.dk> User-Agent: mu4e 1.12.0; emacs 29.2 Date: Thu, 14 Mar 2024 20:41:10 +0100 Message-ID: <87h6h8sisp.fsf@metaspace.dk> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Andreas Hindborg writes: > Miguel Ojeda writes: > >> On Thu, Mar 14, 2024 at 9:58=E2=80=AFAM Andreas Hindborg wrote: >>> >>> Yes, good point. Another option suggested by Miguel is that >>> `__blk_mq_free_request` need not be exported at all. We can make it >>> non-static and then call it from >>> `rust_helper_blk_mq_free_request_internal()`. Then only the latter will >>> be in the kernel image symbol table, which might be better in terms of >>> not exposing `__blk_mq_free_request()` directly. >> >> The helper is not needed, i.e. what I meant was to make it non-static >> and add it to `include/linux/blk-mq.h`. > > The way the current code compiles, kernel::types::AlwaysRefCounted>::dec_ref` is inlined into the `rnull` > module. A relocation for `rust_helper_blk_mq_free_request_internal` > appears in `rnull_mod.ko`. I didn't test it yet, but if > `__blk_mq_free_request` (or the helper) is not exported, I don't think > this would be possible? > I just tested what you suggested Miguel, and I get a link error for `__blk_mq_free_request` being undefined when the module is linked. This is even though the code that calls this function lives in the `kernel` crate, because it is inlined. BR Andreas