FEMU icon indicating copy to clipboard operation
FEMU copied to clipboard

fix page size

Open James23rc opened this issue 1 year ago • 2 comments

Size of a page is 4096 bytes, which is 8 * 512 bytes, not 4096 * 512 bytes(which is 2MB).

James23rc avatar Oct 05 '23 09:10 James23rc

@huaicheng

James23rc avatar Oct 05 '23 09:10 James23rc

Hello James23rc, Thanks for your valid point out. I acknowledged your commit.

However, I have little worries about hardcoding the numbers such as /4096, /8. (I know /4096 things are we did, but still) So I'm considering not to take your commit, at the moment. Please see the reason below.

Size of the page in SSD is also a configurable parameter(Scalability) and hardcoding such as ( lba / 8 ) hinders understanding the code.(Code visibility)

Using macro something like this is better, this is just an example

#define _4KB 4096 
#define LBA_TO_LPN (SSD_PAGE_SIZE / HOST_LBA_SIZE)

Again, appreciate for your commit, we will reflect your point soon :)

inhoinno avatar Oct 14 '23 19:10 inhoinno