kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* block size vs bvec length
@ 2020-04-05 18:17 Michele Sorcinelli
  2020-04-05 23:35 ` Valdis Klētnieks
  0 siblings, 1 reply; 3+ messages in thread
From: Michele Sorcinelli @ 2020-04-05 18:17 UTC (permalink / raw)
  To: kernelnewbies

I created a simple block device driver with a logical queue block size of 512 bytes.

$ cat /sys/block/myblock/queue/physical_block_size
512
$ cat /sys/block/myblock/queue/logical_block_size
512

I used rq_for_each_segment() to print bvec.bv_len of the segments and it
appears to be 4096.

Why is it 4096 rather than 512?

Also writing a block of 4096 bytes with dd to /dev/myblock will result in a
single write request, while writing a block of 512 bytes will result in a read
request followed by a write request.

Can someone explain this behavior?

Thanks,
   Michele.

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

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

end of thread, other threads:[~2020-04-05 23:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-05 18:17 block size vs bvec length Michele Sorcinelli
2020-04-05 23:35 ` Valdis Klētnieks
2020-04-05 23:53   ` Michele Sorcinelli

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).