> There is a layering violation in the code. So what --- you either fix the > layering violation or let it be there and grind your teeth on it. But in > either case, that layering violation won't affect anyone except scsi > developers.

A layering violation is a signal of bad design wherever it occurs, sothat wasn't a SCSI centric argument.

> On the other hand, if you say "because we want to avoid layering violation > in SCSI, every issuer of discard request must supply an empty page", you > create havoc all over the Linux codebase. md, dm, drbd, xvd, virtio --- > whatever you think of, will be allocating a dummy page when constructing > a discard request.

Since I didn't actually say any of that, I suggest you re-read text youquoted above. The phrase "The command transformation belongs in the ULDso that's where the allocation and deallocation should be" might be arelevant one to concentrate on.

> If the layering violation spans only scsi code, it can be eventually > fixed, but this, much worse "layering violation" that will be spanning all > block device midlayers, won't ever be fixed.> > Imagine for example --- a discard request arrivers at a dm-snapshot > device. The driver splits it into chunks, remaps each chunk to the > physical chunk, submits the requests, the elevator merges adjacent > requests and submits fewer bigger requests to the device. Now, if you had > to allocate a zeroed page each time you are splitting the request, that > would exhaust memory and burn cpu needlessly. You delete a 100MB file? --- > fine, allocate a 100MB of zeroed pages.

This is a straw man: You've tried to portray a position I've nevertaken as mine then attack it ... with what is effectively another bogusargument.

It's not an either/or choice. I've asked the relevant parties tocombine the approaches and see if a REQ_TYPE_FS path that does theallocations in the appropriate place, likely the ULD, produces a gooddesign.

> So I say --- let there be a layering violation in the scsi code, but don't > put this problem with a page allocation to all the other bio midlayer > developers.

Thanks for explaining that you have nothing to contribute, I'll makesure you're not on my list of relevant parties.