On Thu, Jun 13, 2019 at 09:42:51AM -0700, James Bottomley wrote: > On Thu, 2019-06-13 at 15:13 +0800, Ming Lei wrote: > > Hi, > > > > Most of drivers use sg helpers to operate sgl, however there is > > still a few drivers which operate sgl directly, this way can't > > work in case of chained sgl. > > This isn't a useful explanation of the issue you make it sound like a > bug, which it isn't: it's a change of behaviour we'd like to introduce > in SCSI. Please reword the explanation more along the lines of > > --- > Scsi MQ makes a large static allocation for the first scatter gather > list chunk for the driver to use. This is a performance headache we'd > like to fix by reducing the size of the allocation to a 2 element > array. Doing this will break the current guarantee that any driver > using SG_ALL doesn't need to use the scatterlist iterators and can get > away with directly dereferencing the array. Thus we need to update all > drivers to use the scatterlist iterators and remove direct indexing of > the scatterlist array before reducing the initial scatterlist > allocation size in SCSI. > --- > > Which explains what we're trying to do and why. > > In particular changelogs like this > > > The current way isn't safe for chained sgl, so use sgl helper to > > operate sgl. > > Are just plain wrong: They were perfectly safe until you altered the > conditions for using non-chained sgls. Please use the above > explanation in the patches, abbreviated if you like, so all recipients > know why this needs doing and that it isn't an existing bug. OK, will update with the above commit log in V3. Thanks, Ming