From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752495AbdLLKLK (ORCPT ); Tue, 12 Dec 2017 05:11:10 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:59854 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751566AbdLLKK6 (ORCPT ); Tue, 12 Dec 2017 05:10:58 -0500 Date: Tue, 12 Dec 2017 11:10:52 +0100 From: Peter Zijlstra To: Tejun Heo Cc: axboe@kernel.dk, linux-kernel@vger.kernel.org, oleg@redhat.com, kernel-team@fb.com, osandov@fb.com Subject: Re: [PATCH 2/6] blk-mq: replace timeout synchronization with a RCU and generation based scheme Message-ID: <20171212101052.6psxrcunka63d5uf@hirez.programming.kicks-ass.net> References: <20171209192525.982030-1-tj@kernel.org> <20171209192525.982030-3-tj@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171209192525.982030-3-tj@kernel.org> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Dec 09, 2017 at 11:25:21AM -0800, Tejun Heo wrote: > diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h > index 8089ca1..e6cfe4b3 100644 > --- a/include/linux/blkdev.h > +++ b/include/linux/blkdev.h > @@ -228,6 +230,27 @@ struct request { > > unsigned short write_hint; > > + /* > + * On blk-mq, the lower bits of ->gstate carry the MQ_RQ_* state > + * value and the upper bits the generation number which is > + * monotonically incremented and used to distinguish the reuse > + * instances. > + * > + * ->gstate_seqc allows updates to ->gstate and other fields > + * (currently ->deadline) during request start to be read > + * atomically from the timeout path, so that it can operate on a > + * coherent set of information. > + */ > + seqcount_t gstate_seqc; > + u64 gstate; We typically name seqcount_t thingies _seq.