Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752195AbbEFRWI (ORCPT ); Wed, 6 May 2015 13:22:08 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:27286 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750930AbbEFRWG (ORCPT ); Wed, 6 May 2015 13:22:06 -0400 Message-ID: <554A4DB7.7070202@fb.com> Date: Wed, 6 May 2015 11:21:59 -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: "Martin K. Petersen" CC: Jeff Moyer , , , , Subject: Re: [PATCH v2] Support for write stream IDs References: <1430856181-19568-1-git-send-email-axboe@fb.com> <55493097.6040007@fb.com> <55493AC1.9090408@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.14.151,1.0.33,0.0.0000 definitions=2015-05-06_05:2015-05-05,2015-05-06,1970-01-01 signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2956 Lines: 60 On 05/05/2015 04:09 PM, Martin K. Petersen wrote: >>>>>> "Jens" == Jens Axboe writes: > > Jens> I'm not trying to make a shortcut. I deliberately do not want to > Jens> make ID generation/assignment part of the kernel. There's no > Jens> reason that can't exist outside of the kernel, in a libstreamid or > Jens> similar. > > That just perpetuates the broken model, though. Why wouldn't we want to > have stream ids readily available inside the kernel to tag journals, > filesystem metadata, data migration, who knows what? > > Having storage micromanage the stream IDs is a non-starter. And it'll > also break things like software RAID, btrfs, LVM, anything that involves > multiple devices. ID X on first RAID disk then needs to be mapped to ID > Y on the second, etc. > > The only sensible solution is for the kernel to manage the stream > IDs. And for them to be plentiful. The storage device is free to ignore > them, do LRU or whatever it pleases to manage them if it has an internal > limit on number of open streams, etc. OK, that does make some sense. That would mean putting the ID management in the kernel, where devices would register a handler to be a part of this process. That would need to include mapping between user/kernel stream IDx and device stream IDx, since they would not necessarily be the same. This assumes we will have devices that manage their own streams, which seems to be the safe bet (that's what is currently out there). That would work for stacked/btrfs setups too. This wont solve the problem of devices having too few streams. But it'll work regardless, we'll just have to push them separately to do that. It's not an easy problem for them either, resource constraints on the device side could exclude supporting as many streams as we would ideally want. > Jens> The current API doesn't have any real limits (it'll work from > Jens> 1..MAX_UINT), and the transport part handles 255 streams at the > Jens> moment. The latter can be easily extended, we can just steal a few > Jens> more bits. Making it 1023 would be a one liner. > > I'm not so worried about the implementation. I'm more worried about it > being conducive to the broken proposal that's on the table. In some ways I get it, you have to start somewhere. The current proposal is useful for _some_ cases, it's not great for everything. As long as it can be expanded to support as many streams as we would want, then it would work. It's (again) a bit of a chicken and egg problem. We need to make some progress, or the whole thing is going to go away. And I think that'd be a shame, since there's definitely merit to passing these lifetime hints to the device. -- Jens Axboe -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/