Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp337032pxj; Wed, 23 Jun 2021 23:53:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPlqvWdiUPUowqX9IvZ/YrKBoK2lpDNjkDIS+8b9SJmFSEJ6IuLdQVyfExzyQxdg2Rb8Qt X-Received: by 2002:a05:6402:6d3:: with SMTP id n19mr5193113edy.248.1624517595474; Wed, 23 Jun 2021 23:53:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624517595; cv=none; d=google.com; s=arc-20160816; b=idrdZ1dmCyxJji+Bg8KyyjAIQ7uMtbMYKAJUJz+7ZefTWzDh3z7p+eY2VTgJ1PiH2t J/ZW6KsPsKY6hSew+il76OaqCQYCsGsync12O9qmtzrOWKkuKAOlKb0Xx1pFc554Kqd9 BxdkWls5bvAONRCWoFCHwYhRGAixlpHawh9siYHxfO1HxzrJiefFNj/82NL3zxQfDHOV ujnTIjojrU0PbbLqkd7tfcF4TJSHg6vzSWtRosso7/3cHNyduXk+hj0HRa+SExjdOuwr S8fETnr8PBFMuGPTgHdojHchzRcPCz9dYE4VXwTEHYGjBQAYinpFVUeFJmKa2XtssbjI aluA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:date:message-id:from:references:cc:to :dkim-signature:subject; bh=BgtTfNOTj1zothhSjLAvTf3wjgMqTb47wm7OBLhZugg=; b=hcVFcahsBNHdXvpTOQOLR5Mc6YnTSBNcaekYN0s20jk2edDaBsu+YzFe7Y3cBGQiMK 4yaaf1ajscjhayM9rmaSX5EQY6Q7WeWf+Rq8XSUXGAZADyjwOZhelApYaNJaK01YrenY rXDHOrVuwCfkfJTgt5YBypb/GzkNKYdn6YiCcehlzRyQ3Z5JGGkYcCkGVM12d4SULR5g U3bAQiSKFuW5qF94HfbYK70ZkjnlDOqqy+bNBYv2VeXgK4XY/VUpcXpx2e6+C89Mu2xM iNkPCYGIgWCdLRI51/wQQ9ChxcP97Ubtjkj5KXSyrzxIsngqZroztrt9HKr7NZBKjxJE Ybkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synology.com header.s=123 header.b=V2DuV9LO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=synology.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g3si2159951eds.538.2021.06.23.23.52.52; Wed, 23 Jun 2021 23:53:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@synology.com header.s=123 header.b=V2DuV9LO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=synology.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231305AbhFXGxL (ORCPT + 99 others); Thu, 24 Jun 2021 02:53:11 -0400 Received: from mail.synology.com ([211.23.38.101]:38814 "EHLO synology.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231132AbhFXGxK (ORCPT ); Thu, 24 Jun 2021 02:53:10 -0400 Subject: Re: [PATCH v3] block: fix trace completion for chained bio DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synology.com; s=123; t=1624517448; bh=S9PH3gMYVY8Uk41vBYmoqe9s+YbYcC3OEOnxZ09adSk=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=V2DuV9LO1rjX81uFaJ16urzZgfeoMD+BXuyqrtX/vm9hl5BUKCQxBnZmFmxek23tU QIqtGHW8vL7x9AV8cqBdUeqhCybjE6a9aFVJN43v6E1lP1dHacUHvaJ1HWsjI+cJY+ h86ZflLo1JPFt5M7lpvoULjKWhjx7wRSV9x8nWhM= To: Christoph Hellwig Cc: axboe@kernel.dk, neilb@suse.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, s3t@synology.com, bingjingc@synology.com, cccheng@synology.com, Wade Liang References: <20210616030810.4901-1-edwardh@synology.com> From: Edward Hsieh Message-ID: <1204c32a-e3b3-95dd-b2b5-b9f6eef4f022@synology.com> Date: Thu, 24 Jun 2021 14:50:30 +0800 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Synology-MCP-Status: no X-Synology-Spam-Flag: no X-Synology-Spam-Status: score=0, required 6, WHITELIST_FROM_ADDRESS 0 X-Synology-Virus-Status: no Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/16/2021 12:53 PM, Christoph Hellwig wrote: > On Wed, Jun 16, 2021 at 11:08:10AM +0800, edwardh wrote: >> @@ -1400,18 +1404,13 @@ void bio_endio(struct bio *bio) >> if (bio->bi_end_io == bio_chain_endio) { >> bio = __bio_chain_endio(bio); >> goto again; >> + } else { >> + blk_throtl_bio_endio(bio); >> + /* release cgroup info */ >> + bio_uninit(bio); >> + if (bio->bi_end_io) >> + bio->bi_end_io(bio); > > No need for an else after a goto. > We are suggested by Neil Brown in the last version that from the comment, the bio_chain_endio handling is used *only* to avoid deep recursion so it should be at the end of the function. Therefore, the position of blk_throtl_bio_endio() and bio_uninit() are a bit odd. We believe that blk_throtl_bio_endio() and bio_uninit() is in the correct position now. And adding an else closure is our attempt to make it more clear. If it's not necessary then V2 patch should work to fix the missing completion traces. Should we resend PATCH V2? Thank you, Edward