Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp249957lqh; Thu, 30 May 2024 23:17:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVPuGDLSN2iebadKRIkVUN8XGfA6IAOffAvZxL/YeBPKyhjqQ17On4AChHZM83S1L989uZh+WNJ27FBMGJXEvRbSeo/1XU4jpZuNhP7CA== X-Google-Smtp-Source: AGHT+IE78C29LXTmJoFu/mPsi/AWZWfTJEjiIhwDl5bCI1B9YKn+lQPdhMQ8t3eIE8UDjhLcWMbJ X-Received: by 2002:a05:6870:fb8d:b0:250:831b:49b1 with SMTP id 586e51a60fabf-2508bd1145cmr1165652fac.56.1717136240753; Thu, 30 May 2024 23:17:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717136240; cv=pass; d=google.com; s=arc-20160816; b=KSvRVcE3PBzI9ADM4nd8xyiqDvxrMRIVUbyMpXO3pHfUEVv1terJlwOyMwz5eaMlUa 6N9cD5RPa8wI2dcgx7Xe7voKQY3R5PJ75Rmvut4zBGqLx+tiKde3PuYBvKFF1W/CiP6p vx6ScLHUgjpqYL7kjS+Xq47AQRQ0CMVyPamlPM1rZKL+qKnUN29Ekk9WqPPL0XOqFqGt nHJGfkUu4vUkYKbn1WE/acL75Q5Sn7xF7/4LDDzLdaxh/hSGWJFuiJU4wqsjbFfc5/M5 AHHaL5PnsgGdMUsUYzWjuTCU8G+6jLuE3aDWOxw3LysR5fFPb4rMaotK7P6KrzjY49Oz o84g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=LFzB5uKwlEIIpKVCpHZDDnwzF7ajR7yCIigK4/KgGt0=; fh=Tmqg972NhXV4VOBnTpmoweK2FK1eCv1PAvFSGbwDOU4=; b=AYt3XjloDvgYSTv7KdkzevEzPCLGNsmPNgeQP0Xf/52eePuQ80DG+b+5DaSlIspSz8 6aIi4l+tKpWYFaYGrhce6rlKcpWhMUq1JuNo+VHZybns53ILCtvup92SqOXngiLNkqqX Nswgtj/+fUd1JejrzvkR2zxF8kdEab6gZocB37Xmjy+uBUyjnASNbmD5m1+TJKMvrKTH sv5GNvtRyLVHBYiWfDfK6NGo0BIcN/px/8CvW5hZgfzeOFhxo5HEJaDiFuPPwFUc61Bw bKVyOOxWNhAndm6g/1Hi1aU0j3CihgOpFDN82bPaCD9Cea0CwVFRStpo09mH9Kl6pzdE zcEw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-kernel+bounces-196337-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196337-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c3540f8469si957998a12.38.2024.05.30.23.17.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 23:17:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-196337-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-kernel+bounces-196337-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196337-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 61AB32834BB for ; Fri, 31 May 2024 06:17:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 62C107E78B; Fri, 31 May 2024 06:17:14 +0000 (UTC) Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (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 AB56728DA5; Fri, 31 May 2024 06:17:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717136233; cv=none; b=rxo3VCdfsELlHlwaCW1/FcZRrG370GeY8gFwSy79AnQQYGXoH2CvAI4zQAvPoBLGMgbG75gBpBfkLoiXVomq1GBOI/lu1aVMlz8QB+2s2ugcq594DKOkwaD/Xva3oVx0Jzan4pW9X2T+BtwAAkBgiwk+EbtdefYIwXEWXYFHXXQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717136233; c=relaxed/simple; bh=iueQtP9Gslcg5KRKNhCalSsLgvkR0FSUv1bpe6Pdegg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TYbnmKez8ayRlQYeae4xdWSl19GNLrOXmBtZ6gQjFQz3wOosDSJ+nYah0uHsAz91ql4IAQK2I3ALA+EuDsbn2Tez37qqfoXiJpukuXQQFm/sZg5pWgX/2uOcU/8htgcjWd91z9E++30JCeMfUbNNxCLCmK9KhmO0wic0k58h2Hw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 57F7668BEB; Fri, 31 May 2024 08:17:08 +0200 (CEST) Date: Fri, 31 May 2024 08:17:08 +0200 From: Christoph Hellwig To: Chengming Zhou Cc: Friedrich Weber , axboe@kernel.dk, ming.lei@redhat.com, hch@lst.de, bvanassche@acm.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, zhouchengming@bytedance.com Subject: Re: [PATCH v4 4/4] blk-flush: reuse rq queuelist in flush state machine Message-ID: <20240531061708.GB18075@lst.de> References: <14b89dfb-505c-49f7-aebb-01c54451db40@proxmox.com> <984f1f77-288c-441a-a649-5f320249b576@linux.dev> <4d799672-378b-42b1-896b-38df2c5e9c84@proxmox.com> <0783d367-4608-4b16-9b88-6eaf5d5706eb@linux.dev> <8b1400e6-b35e-486b-8ea0-de76270267c0@linux.dev> <87f495c2-7504-4d22-b355-608b13c456cd@linux.dev> <09be2bc6-d16a-4740-908a-f157dcd97ca8@linux.dev> 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=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) On Wed, May 29, 2024 at 04:50:02PM +0800, Chengming Zhou wrote: > Yes, because we use list_move_tail() in the flush sequences. Maybe we can > just use list_add_tail() so we don't need the queuelist initialized. It > should be ok since rq can't be on any list when PREFLUSH or POSTFLUSH, > so there isn't any move actually. Sounds good. > But now I'm concerned that rq->queuelist maybe changed by driver after > request end? How could the driver change it? > > Also, just out of interest: Can you estimate whether this issue is > > specific to software RAID setups, or could similar NULL pointer > > dereferences also happen in setups without software RAID? > > I think it can also happen without software RAID. Seems to be about batch allocation. So you either need a plug in the stacking device, or io_uring. I guess people aren't using the io_uring high performance options on devices with a write cache all that much, as that should immediately reproduce the problem.