All of lore.kernel.org
 help / color / mirror / Atom feed
* Cmd - comp write
@ 2014-04-24  3:37 Learner
  2014-04-24  9:50 ` Ebrahim Hashemi
  2014-04-24 13:58 ` Matthew Wilcox
  0 siblings, 2 replies; 5+ messages in thread
From: Learner @ 2014-04-24  3:37 UTC (permalink / raw)


Hello

How frequently is Fused command - compare-write used? 
Is it for avoiding writes for SSDs if thee is no change? Ie read and compare the block to be written and don't write if there is no change.. 

Thanks 

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

* Cmd - comp write
  2014-04-24  3:37 Cmd - comp write Learner
@ 2014-04-24  9:50 ` Ebrahim Hashemi
  2014-04-24 13:58 ` Matthew Wilcox
  1 sibling, 0 replies; 5+ messages in thread
From: Ebrahim Hashemi @ 2014-04-24  9:50 UTC (permalink / raw)


I think it could be used for that purpose, but it can also be used like a "semaphore" or "test and set". For example,  alleviating the need for SCSI persistent reservation.

-----Original Message-----
From: Linux-nvme [mailto:linux-nvme-bounces@lists.infradead.org] On Behalf Of Learner
Sent: Wednesday, April 23, 2014 8:38 PM
To: linux-nvme
Subject: Cmd - comp write 

Hello

How frequently is Fused command - compare-write used? 
Is it for avoiding writes for SSDs if thee is no change? Ie read and compare the block to be written and don't write if there is no change.. 

Thanks 

_______________________________________________
Linux-nvme mailing list
Linux-nvme at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

* Cmd - comp write
  2014-04-24  3:37 Cmd - comp write Learner
  2014-04-24  9:50 ` Ebrahim Hashemi
@ 2014-04-24 13:58 ` Matthew Wilcox
  2014-04-24 17:03   ` Learner Study
  1 sibling, 1 reply; 5+ messages in thread
From: Matthew Wilcox @ 2014-04-24 13:58 UTC (permalink / raw)


On Wed, Apr 23, 2014@08:37:39PM -0700, Learner wrote:
> Hello
> 
> How frequently is Fused command - compare-write used? 
> Is it for avoiding writes for SSDs if thee is no change? Ie read and compare the block to be written and don't write if there is no change.. 

Compare-and-Write is a building block for an (unspecified, advisory)
locking protocol.  If two entities wish to gain exclusive access to a
range of LBAs, they can agree on a block to use as their lock, and agree
on a bit-pattern to be found in that block to indicate 'unlocked'.

If anyone is using it, they're doing so through ioctls; there's no way
to submit a BIO that maps to a compare-and-write.

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

* Cmd - comp write
  2014-04-24 13:58 ` Matthew Wilcox
@ 2014-04-24 17:03   ` Learner Study
  2014-04-24 17:43     ` Matthew Wilcox
  0 siblings, 1 reply; 5+ messages in thread
From: Learner Study @ 2014-04-24 17:03 UTC (permalink / raw)


Thanks. So its not really used to optimize SSD write operation
per-se...correct? Its only used for locking purpose mainly. I'm not
too familiar with the upper application layers...is "locking" a very
common operation used in storage work? I would think so - for eg. to
coordinate writes to namespaces and its accesses, this could be
used...is that understanding correct?

Thanks!
PS: Apologize if this is not the right forum, but would appreciate any
insights from experts..

On Thu, Apr 24, 2014@6:58 AM, Matthew Wilcox <willy@linux.intel.com> wrote:
> On Wed, Apr 23, 2014@08:37:39PM -0700, Learner wrote:
>> Hello
>>
>> How frequently is Fused command - compare-write used?
>> Is it for avoiding writes for SSDs if thee is no change? Ie read and compare the block to be written and don't write if there is no change..
>
> Compare-and-Write is a building block for an (unspecified, advisory)
> locking protocol.  If two entities wish to gain exclusive access to a
> range of LBAs, they can agree on a block to use as their lock, and agree
> on a bit-pattern to be found in that block to indicate 'unlocked'.
>
> If anyone is using it, they're doing so through ioctls; there's no way
> to submit a BIO that maps to a compare-and-write.

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

* Cmd - comp write
  2014-04-24 17:03   ` Learner Study
@ 2014-04-24 17:43     ` Matthew Wilcox
  0 siblings, 0 replies; 5+ messages in thread
From: Matthew Wilcox @ 2014-04-24 17:43 UTC (permalink / raw)


On Thu, Apr 24, 2014@10:03:30AM -0700, Learner Study wrote:
> Thanks. So its not really used to optimize SSD write operation
> per-se...correct? Its only used for locking purpose mainly. I'm not
> too familiar with the upper application layers...is "locking" a very
> common operation used in storage work? I would think so - for eg. to
> coordinate writes to namespaces and its accesses, this could be
> used...is that understanding correct?

Locking is almost never used.  Usually one entity controls exclusive
access to the media and coordinates all accesses to it.  The use case
is multipath environments like dual-ported drives or NAS where there may
be multiple independent entities competing for access to the same media.

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

end of thread, other threads:[~2014-04-24 17:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-24  3:37 Cmd - comp write Learner
2014-04-24  9:50 ` Ebrahim Hashemi
2014-04-24 13:58 ` Matthew Wilcox
2014-04-24 17:03   ` Learner Study
2014-04-24 17:43     ` Matthew Wilcox

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.