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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3575CC433ED for ; Mon, 12 Apr 2021 10:30:14 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A12D16134F for ; Mon, 12 Apr 2021 10:30:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A12D16134F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=tempfail smtp.mailfrom=dm-devel-bounces@redhat.com Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-588-nAHraM65PpqeWf1T24W_OA-1; Mon, 12 Apr 2021 06:30:09 -0400 X-MC-Unique: nAHraM65PpqeWf1T24W_OA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2E8446D4E8; Mon, 12 Apr 2021 10:30:04 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D314E5D9F0; Mon, 12 Apr 2021 10:30:03 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 5B25544A5A; Mon, 12 Apr 2021 10:30:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13CAU0SV030817 for ; Mon, 12 Apr 2021 06:30:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id DC14E20D6FEA; Mon, 12 Apr 2021 10:30:00 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D71362095BAF for ; Mon, 12 Apr 2021 10:29:58 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 925BC1854CA2 for ; Mon, 12 Apr 2021 10:29:58 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-209-hMgFyz0-PM2fC7dI1kPk7Q-1; Mon, 12 Apr 2021 06:29:56 -0400 X-MC-Unique: hMgFyz0-PM2fC7dI1kPk7Q-1 Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lVtpD-004BtM-65; Mon, 12 Apr 2021 10:29:48 +0000 Date: Mon, 12 Apr 2021 11:29:47 +0100 From: Christoph Hellwig To: Ming Lei Message-ID: <20210412102947.GA998763@infradead.org> References: <20210401021927.343727-1-ming.lei@redhat.com> <20210401021927.343727-9-ming.lei@redhat.com> <20210412095427.GA987123@infradead.org> MIME-Version: 1.0 In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: dm-devel@redhat.com Cc: Jens Axboe , linux-block@vger.kernel.org, Mike Snitzer , Christoph Hellwig , dm-devel@redhat.com, Jeffle Xu Subject: Re: [dm-devel] [PATCH V5 08/12] block: use per-task poll context to implement bio based io polling X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Mon, Apr 12, 2021 at 06:20:55PM +0800, Ming Lei wrote: > > > +static inline void *bio_grp_data(struct bio *bio) > > > +{ > > > + return bio->bi_poll; > > > +} > > > > What is the purpose of this helper? And why does it have to lose the > > type information? > > This patch stores bio->bi_end_io(shared with ->bi_poll) into one per-task > data structure, and links all bios sharing same .bi_end_io into one list > via ->bi_end_io. And their ->bi_end_io is recovered before calling > bio_endio(). > > The helper is used for checking if one bio can be added to bio group, > and storing the data. The helper just serves for document purpose. > > And the type info doesn't matter. So why is bi_poll typed to start with then just to need a accessor to remove the typer information? -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel 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 X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29E6EC433ED for ; Mon, 12 Apr 2021 10:29:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E58C36128B for ; Mon, 12 Apr 2021 10:29:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237730AbhDLKaN (ORCPT ); Mon, 12 Apr 2021 06:30:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237356AbhDLKaM (ORCPT ); Mon, 12 Apr 2021 06:30:12 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE43DC061574 for ; Mon, 12 Apr 2021 03:29:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=4S/yEhmgO1q0uaRY8hfA7XVwhgWUMLpynMUG2SjAxzw=; b=FnR+sH0853DVufpazIdybBXyAd Grp8h0rRO0FnSaQt3yXOJRqM/toHq1ginCFi44W7I3nHf+juSUPJMqx+o1EyGZFGOTyva/Yj3D71h PiyxLUIbbiiSTACz3YxiHWfa2yOcztS+URD+cmbyyKFk/khWlijWPm8xy8wJVAKAxBZqylszyhhp+ /tsfj6JoGpQ1sAjs328cAo2wd2FAjcvoAGZKjU1cUWN11XAoY6WzbHowPUTkh6g97yvctUOfLVxrW QT2aL3r+oRdKX2eakW1PBkrBaq5PCqmF9ipZctB3TAL5PBpXwvj3iTMghqYjvhV4nM+jvDImG5fGt 1GcERgCQ==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lVtpD-004BtM-65; Mon, 12 Apr 2021 10:29:48 +0000 Date: Mon, 12 Apr 2021 11:29:47 +0100 From: Christoph Hellwig To: Ming Lei Cc: Christoph Hellwig , Jens Axboe , linux-block@vger.kernel.org, Jeffle Xu , Mike Snitzer , dm-devel@redhat.com, Hannes Reinecke Subject: Re: [PATCH V5 08/12] block: use per-task poll context to implement bio based io polling Message-ID: <20210412102947.GA998763@infradead.org> References: <20210401021927.343727-1-ming.lei@redhat.com> <20210401021927.343727-9-ming.lei@redhat.com> <20210412095427.GA987123@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Mon, Apr 12, 2021 at 06:20:55PM +0800, Ming Lei wrote: > > > +static inline void *bio_grp_data(struct bio *bio) > > > +{ > > > + return bio->bi_poll; > > > +} > > > > What is the purpose of this helper? And why does it have to lose the > > type information? > > This patch stores bio->bi_end_io(shared with ->bi_poll) into one per-task > data structure, and links all bios sharing same .bi_end_io into one list > via ->bi_end_io. And their ->bi_end_io is recovered before calling > bio_endio(). > > The helper is used for checking if one bio can be added to bio group, > and storing the data. The helper just serves for document purpose. > > And the type info doesn't matter. So why is bi_poll typed to start with then just to need a accessor to remove the typer information?