Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp735112lqb; Fri, 15 Mar 2024 05:18:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX8PLcnIQ8vtHI1DaRapwY0ae9SHkelRTrtK5kgxT2+eWQ4l/LWwEhsFe8DYKVha7lBfR8PR/QohXNuUZju8/U5LWGdt1Q6M4KIYv0ArA== X-Google-Smtp-Source: AGHT+IGil6u/mNQHlOIeoXwFYEKupgwVcBVqYruV/PlqB6lw9/EthcLGMF6nE7Khgnxd87b78imE X-Received: by 2002:a05:6402:3416:b0:566:cef8:5440 with SMTP id k22-20020a056402341600b00566cef85440mr2703016edc.32.1710505101245; Fri, 15 Mar 2024 05:18:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710505101; cv=pass; d=google.com; s=arc-20160816; b=GcxjS8ZrlE7PIRg5Mnwp2Oa4mDyrdjQJjqG0eCUmB/Ps3OTgF8+WyrbdUbV9WKWnuO I84jtiKopQUZmLxysDI/nRrDUpgsJbWcdolEYF3sOBfOoWPRXUiyAbx8fRpmgyBriXhT +EeR3aMTiiresVv58dvB6cs79y53D+sLT8chTn16SgRkITDCtBjvANe6T4rHo8m7RwA9 mEuHicR9R+qMbQctq/UDlQ89PJSVvBKkluj3i9aa6sx0RY/ckrBfbijZdTfStPbr/GaT GtiukpsTB6hEBaJGrHOnbh1b1EmxqJnClhegJqCuheBr+IC8PvZI/i3NvZPKOmmlGKcl 4peQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=RkV+0UDwdwnEtpTzSiYVVxf6L/nYIk2GiTDZOWrLMLA=; fh=2ALj7ZuRI8wiBKx/Sa9VDPFtDLAJs86a0hiSYNUSjPc=; b=mASNLaWN+HkIq2jDCgdlCqyiGDZVCVKvvo4xJxVX+xvv2tcrqvA/hwQir4VUmq8bLf CicgFinewY9TVPPORORex19QVEWkAAK7ciYniNpjFRBZn7ISeJqfknyanKHHXM+ea6vk 7zLV1SfcJjESJFJqC6YfqnD6M6P5pXOEA9l6jg+yp04k040MZNuBNJ+/vw7CEQrwEBJc d35W4oxa6HhJN4isRPwUc7SNCewVZ7ESr2pqda4VtH1cWGznyZYYwlAL6do1cBtg6pv7 pfzfdTbYussCldK7LfMbYtbO5G6TvON70tyikiSfXip7P/a3zEBZ/Iwakn+Lwh1x9JB2 KUBg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=O8CPO8hk; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-104386-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104386-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id l12-20020a056402254c00b005688ef91a35si1752258edb.24.2024.03.15.05.18.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 05:18:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-104386-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=O8CPO8hk; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-104386-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104386-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id EF99F1F22AE4 for ; Fri, 15 Mar 2024 12:18:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9A2821C68A; Fri, 15 Mar 2024 12:18:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="O8CPO8hk" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 130E61C687 for ; Fri, 15 Mar 2024 12:18:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710505091; cv=none; b=CidXnolDvhvhYEQeih7FbHN4XcxRPfcBaj4wwF7Ne+peGx8q/SEG7/6gKUwrrLLVP3nlPsixrftqXP9Ktu8kVA/JPchb3zL22ce6Xm7kGrDpJM7t/PN1ExS4R4m9t0DGS8+OEQRz1oX87u805Da8Jxi7LSyWm4vjA2HDMYRZckA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710505091; c=relaxed/simple; bh=OXBEZqhs7kDse6BVOLPyb/0TPxks7Uu4zNmjP25UPs4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VjZczs7uP0emNMMBgEDXVVmDmbXlRDdk0upjEnbFMITwNhBWe47jo84D5EcW3Hm+g4IQWbYfiZYoFgoiUrr/rUOsuHQSjjC2dFj7Ti+9eWHZmQExVT+WtxT1aevLZaRr4XAemjgc9PBxcJ8KUCnWCnP8U/iiS1R6XjaqaHLesuI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=O8CPO8hk; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710505089; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RkV+0UDwdwnEtpTzSiYVVxf6L/nYIk2GiTDZOWrLMLA=; b=O8CPO8hkFsReA0TzyII3P7kY5yAG7zq6uPdT7XywlxFaoDTb/jKmOw9OdndNlH+KlYg200 gWEWpnZOPsAXpCYu9yuLJWHpL75ehgQ6rriX7wjOP8dpgSX+QvGQ0Lpit2iFB9gJ+aCdKa 1dlxPVfrM2l1n+yqmbRpbQS4YqKliGw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-423-2P5q7AxxOZCO0dI-vc4yOw-1; Fri, 15 Mar 2024 08:17:50 -0400 X-MC-Unique: 2P5q7AxxOZCO0dI-vc4yOw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1E5F5185A781; Fri, 15 Mar 2024 12:17:49 +0000 (UTC) Received: from fedora (unknown [10.72.116.52]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D18562166B4F; Fri, 15 Mar 2024 12:17:35 +0000 (UTC) Date: Fri, 15 Mar 2024 20:17:31 +0800 From: Ming Lei To: Andreas Hindborg Cc: Miguel Ojeda , Jens Axboe , Keith Busch , Boqun Feng , Christoph Hellwig , 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 , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Alice Ryhl , Chaitanya Kulkarni , Luis Chamberlain , Yexuan Yang <1182282462@bupt.edu.cn>, Sergio =?iso-8859-1?Q?Gonz=E1lez?= 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 Message-ID: References: <20240313110515.70088-1-nmi@metaspace.dk> <20240313110515.70088-2-nmi@metaspace.dk> <87il1ptck0.fsf@metaspace.dk> <87plvwsjn5.fsf@metaspace.dk> <8734ssrkxd.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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8734ssrkxd.fsf@metaspace.dk> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 On Fri, Mar 15, 2024 at 08:52:46AM +0100, Andreas Hindborg wrote: > Miguel Ojeda writes: > > > On Thu, Mar 14, 2024 at 8:23 PM Andreas Hindborg wrote: > >> > >> 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? > > > > Yeah, something needs to be exported since there is a generic > > involved, but even if you want to go the route of exporting only a > > different symbol, you would still want to put it in the C header so > > that you don't get the C missing declaration warning and so that we > > don't have to write the declaration manually in the helper. > > That is what I did: > > @@ -703,6 +703,7 @@ int blk_mq_alloc_sq_tag_set(struct blk_mq_tag_set *set, > unsigned int set_flags); > void blk_mq_free_tag_set(struct blk_mq_tag_set *set); > > +void __blk_mq_free_request(struct request *rq); > void blk_mq_free_request(struct request *rq); > int blk_rq_poll(struct request *rq, struct io_comp_batch *iob, > unsigned int poll_flags); Can you explain in detail why one block layer internal helper is called into rnull driver directly? It never happens in C driver code. Thanks, Ming