linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH RFC] statx.2: Add stx_atomic_write_unit_max_opt
       [not found]       ` <7311545c-e169-4875-bc6c-97446eea2c45@oracle.com>
@ 2025-03-23  6:40         ` Christoph Hellwig
  2025-04-03 15:07           ` John Garry
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2025-03-23  6:40 UTC (permalink / raw)
  To: John Garry
  Cc: Christoph Hellwig, alx, brauner, djwong, dchinner, linux-man,
	linux-fsdevel, linux-xfs, linux-kernel, ojaswin, ritesh.list,
	martin.petersen, linux-api

On Fri, Mar 21, 2025 at 10:20:21AM +0000, John Garry wrote:
> Coming back to what was discussed about not adding a new flag to fetch this 
> limit:
>
> > Does that actually work?  Can userspace assume all unknown statx
> > fields are padded to zero?
>
> In cp_statx, we do pre-zero the statx structure. As such, the rule "if 
> zero, just use hard limit unit max" seems to hold.

Ok, canwe document this somewhere?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH RFC] statx.2: Add stx_atomic_write_unit_max_opt
  2025-03-23  6:40         ` [PATCH RFC] statx.2: Add stx_atomic_write_unit_max_opt Christoph Hellwig
@ 2025-04-03 15:07           ` John Garry
  2025-04-04  9:06             ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: John Garry @ 2025-04-03 15:07 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: alx, brauner, djwong, dchinner, linux-man, linux-fsdevel,
	linux-xfs, linux-kernel, ojaswin, ritesh.list, martin.petersen,
	linux-api

On 23/03/2025 06:40, Christoph Hellwig wrote:

I'm not happy with the name stx_atomic_write_unit_max_opt - it's vague 
and subjective.

So I am thinking one of these:
a. stx_atomic_write_unit_max_dev
b. stx_atomic_write_unit_max_bdev
c. stx_atomic_write_unit_max_align
d. stx_atomic_write_unit_max_hw

The terms dev (or device) and bdev are already used in the meaning of 
some members in struct statx, so not too bad. However, when we support 
large atomic writes for XFS rtvol, the bdev atomic write limit and 
rtextsize would influence this value (so just bdev might be a bit 
misleading in the name).

As for stx_atomic_write_unit_max_align, it would mean "max 
alignment/granularity" for possible HW offload. Not great.

stx_atomic_write_unit_max_hw would match the bdev request queue sysfs 
names, but that it a different concept to statx. And it has the same 
issue as bdev for rtvol, above.

Any further suggestions or comments?

> On Fri, Mar 21, 2025 at 10:20:21AM +0000, John Garry wrote:
>> Coming back to what was discussed about not adding a new flag to fetch this
>> limit:
>>
>>> Does that actually work?  Can userspace assume all unknown statx
>>> fields are padded to zero?
>>
>> In cp_statx, we do pre-zero the statx structure. As such, the rule "if
>> zero, just use hard limit unit max" seems to hold.
> 
> Ok, canwe document this somewhere?
> 

Sure, but I want to decide on the name first.. if using 
stx_atomic_write_unit_max_bdev/_dev/hw, then it would be odd that this 
value reports 0 for old kernels (as the bdev limit would never really be 0).

Then if we have rule "stx_atomic_write_unit_max_bdev=0 means that 
stx_atomic_write_unit_max_bdev = stx_atomic_write_unit_max", this breaks 
for when we solely rely on FS-based atomics, as 
stx_atomic_write_unit_max_bdev would be 0 there and that should really 
mean 0 (and not stx_atomic_write_unit_max).

So then we should have a new mask to fetch this field, which is not 
ideal, but ok.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH RFC] statx.2: Add stx_atomic_write_unit_max_opt
  2025-04-03 15:07           ` John Garry
@ 2025-04-04  9:06             ` Christoph Hellwig
  2025-04-04  9:23               ` John Garry
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2025-04-04  9:06 UTC (permalink / raw)
  To: John Garry
  Cc: Christoph Hellwig, alx, brauner, djwong, dchinner, linux-man,
	linux-fsdevel, linux-xfs, linux-kernel, ojaswin, ritesh.list,
	martin.petersen, linux-api

On Thu, Apr 03, 2025 at 04:07:04PM +0100, John Garry wrote:
> So I am thinking one of these:
> a. stx_atomic_write_unit_max_dev
> b. stx_atomic_write_unit_max_bdev
> c. stx_atomic_write_unit_max_align
> d. stx_atomic_write_unit_max_hw
>
> The terms dev (or device) and bdev are already used in the meaning of some 
> members in struct statx, so not too bad. However, when we support large 
> atomic writes for XFS rtvol, the bdev atomic write limit and rtextsize 
> would influence this value (so just bdev might be a bit misleading in the 
> name).

Don't.  Especially when you have a natively out of write file system
that optimized case will not involve the usual hardware offload.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH RFC] statx.2: Add stx_atomic_write_unit_max_opt
  2025-04-04  9:06             ` Christoph Hellwig
@ 2025-04-04  9:23               ` John Garry
  2025-04-07  6:51                 ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: John Garry @ 2025-04-04  9:23 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: alx, brauner, djwong, dchinner, linux-man, linux-fsdevel,
	linux-xfs, linux-kernel, ojaswin, ritesh.list, martin.petersen,
	linux-api

On 04/04/2025 10:06, Christoph Hellwig wrote:
> On Thu, Apr 03, 2025 at 04:07:04PM +0100, John Garry wrote:
>> So I am thinking one of these:
>> a. stx_atomic_write_unit_max_dev
>> b. stx_atomic_write_unit_max_bdev
>> c. stx_atomic_write_unit_max_align
>> d. stx_atomic_write_unit_max_hw
>>
>> The terms dev (or device) and bdev are already used in the meaning of some
>> members in struct statx, so not too bad. However, when we support large
>> atomic writes for XFS rtvol, the bdev atomic write limit and rtextsize
>> would influence this value (so just bdev might be a bit misleading in the
>> name).
> 
> Don't.  Especially when you have a natively out of write file system
> that optimized case will not involve the usual hardware offload.
> 
> 
stx_atomic_write_unit_max_opt it is then.

Or stx_atomic_write_unit_max_optimal or stx_atomic_write_unit_max_fast. 
Or similar..

cheers,
John

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH RFC] statx.2: Add stx_atomic_write_unit_max_opt
  2025-04-04  9:23               ` John Garry
@ 2025-04-07  6:51                 ` Christoph Hellwig
  0 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2025-04-07  6:51 UTC (permalink / raw)
  To: John Garry
  Cc: Christoph Hellwig, alx, brauner, djwong, dchinner, linux-man,
	linux-fsdevel, linux-xfs, linux-kernel, ojaswin, ritesh.list,
	martin.petersen, linux-api

On Fri, Apr 04, 2025 at 10:23:09AM +0100, John Garry wrote:
>> that optimized case will not involve the usual hardware offload.
>>
>>
> stx_atomic_write_unit_max_opt it is then.
>
> Or stx_atomic_write_unit_max_optimal or stx_atomic_write_unit_max_fast. Or 
> similar..

As we've used opt in various other ABIs I'd stick to that.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-04-07  6:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20250319114402.3757248-1-john.g.garry@oracle.com>
     [not found] ` <20250320070048.GA14099@lst.de>
     [not found]   ` <c656fa4d-eb76-4caa-8a71-a8d8a2ba6206@oracle.com>
     [not found]     ` <20250320141200.GC10939@lst.de>
     [not found]       ` <7311545c-e169-4875-bc6c-97446eea2c45@oracle.com>
2025-03-23  6:40         ` [PATCH RFC] statx.2: Add stx_atomic_write_unit_max_opt Christoph Hellwig
2025-04-03 15:07           ` John Garry
2025-04-04  9:06             ` Christoph Hellwig
2025-04-04  9:23               ` John Garry
2025-04-07  6:51                 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).