From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753179AbbDRTxX (ORCPT ); Sat, 18 Apr 2015 15:53:23 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:40487 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751299AbbDRTxT (ORCPT ); Sat, 18 Apr 2015 15:53:19 -0400 Message-ID: <5532B62A.3010906@fb.com> Date: Sat, 18 Apr 2015 13:53:14 -0600 From: Jens Axboe User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Andreas Dilger CC: , , , Subject: Re: [PATCH 1/7] block: add support for carrying a stream ID in a bio References: <1427296070-8472-1-git-send-email-axboe@fb.com> <1427296070-8472-2-git-send-email-axboe@fb.com> In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.54.13] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-04-18_02:2015-04-17,2015-04-18,1970-01-01 signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/09/2015 04:46 PM, Andreas Dilger wrote: > On Mar 25, 2015, at 9:07 AM, Jens Axboe wrote: >> >> The top bits of bio->bi_flags are reserved for keeping the >> allocation pool, set aside the next eight bits for carrying >> a stream ID. That leaves us with support for 255 streams, >> 0 is reserved as a "stream not set" value. > > I understand that the stream ID is not related to specific priority > of an IO request. However, I'm wondering how this patch series > interacts with some of the other patch series that add cache priority > hints? Is there a danger of running out of space in the IO pipeline > for the additional cache hints if this is using 8 bits? That's always a risk, of course, but that goes for most features that need to carry more data in struct bio (or elsewhere). Otherwise we'll have to bite the bullet and add a new field. >> +/* >> + * after the pool bits, next 8 bits are for the stream id >> + */ >> +#define BIO_STREAM_BITS (8) >> +#define BIO_STREAM_OFFSET (BITS_PER_LONG - 12) > > Should this really be: > > #define BIO_STREAM_OFFSET (BIO_POOL_OFFSET - BIO_STREAM_BITS) > > Otherwise there is a risk of conflict if someone changes BIO_POOL_BITS. Good point, that would be cleaner. I'll make that change. -- Jens Axboe