linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Boaz Harrosh <openosd@gmail.com>
To: Ross Zwisler <ross.zwisler@linux.intel.com>,
	Boaz Harrosh <boaz@plexistor.com>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, Matthew Wilcox <willy@linux.intel.com>,
	Sagi Manole <sagi@plexistor.com>,
	Yigal Korman <yigal@plexistor.com>
Subject: Re: [RFC 4/9] SQUASHME: prd: Fixs to getgeo
Date: Thu, 21 Aug 2014 12:47:55 +0300	[thread overview]
Message-ID: <53F5C04B.5000900@gmail.com> (raw)
In-Reply-To: <1408572624.26863.17.camel@rzwisler-mobl1.amr.corp.intel.com>

On 08/21/2014 01:10 AM, Ross Zwisler wrote:
> On Wed, 2014-08-13 at 15:14 +0300, Boaz Harrosh wrote:
<>
>>  static int prd_getgeo(struct block_device *bd, struct hd_geometry *geo)
>>  {
>> -	/* some standard values */
>> -	geo->heads = 1 << 6;
>> -	geo->sectors = 1 << 5;
>> -	geo->cylinders = get_capacity(bd->bd_disk) >> 11;
>> +	/* Just tell fdisk to get out of the way. The math here is so
>> +	 * convoluted and does not make any sense at all. With all 1s
>> +	 * The math just gets out of the way.
>> +	 * NOTE: I was trying to get some values that will make fdisk
>> +	 * Want to align first sector on 4K (like 8, 16, 20, ... sectors) but
>> +	 * nothing worked, I searched the net the math is not your regular
>> +	 * simple multiplication at all. If you managed to get these please
>> +	 * fix here. For now we use 4k physical sectors for this
>> +	 */
>> +	geo->heads = 1;
>> +	geo->sectors = 1;
>> +	geo->cylinders = 1;
>>  	return 0;
>>  }
> 
> I'm okay with this change, but can you let me know in which case fdisk was
> previously doing the wrong thing?  I'm just curious because I never saw it
> misbehave, and wonder what else I should be testing.
> 

OK fdisk was doing a a few wrong things for us, this one here fixes one of
them.

Ways to reproduce
You need to have a small enough device, how small I do not know, but with
a 1G device fdisk will offer a 2048 first sectors [1M] always, so with big
devices you will not see this.

But with small devices without this patch fdisk will offer I can't remember
I think it was 18 originally (note the not 4K alignment) and 20 with my
other 4k-phisical patch.
With this one applied it will give me 8 as possible first sector.

What fdisk does is takes bunch of stuff into consideration and uses the
maximum as its base alignment. Then it has more code about the very
first sector that needs to be aligned on the alignment factor but has more
considerations like device size and stuff I guess it wants 1M at start of
disk to leave space for a boot sector.

I would love it if for brd and pmem fdisk will always offer 8, I intend to
send a patch to fdisk to fix that.

But regarding the above, with high values here we can get higher first sector
and funny alignments, with all 1(s) this math gets out of the way.

> Regarding the note in the comment, is this addressed by the
> blk_queue_physical_block_size() and prd->prd_queue->limits.io_min changes in
> your patch 5/9, or is it an open issue?  Either way, can we nix the NOTE?
> 

Yes  5/9 set-physical-sector to 4k fixes this problem and with that
fdisk will not offer the wrong numbers

What you mean nix, get rid of it? We should say something. I will try to
shorten it to a single paragraph, let me send you a fix.

> Also, you put "SQUASHME" on this patch.  I'm planning on squashing all of my
> patches together into an "initial version" type patch (see
> https://github.com/01org/prd).  Based on this, it probably makes sense to keep
> it separate so you get credit for the patch?
> 

The initial version did not include the getgeo patch and the rw_page patch.
I think it makes sense to keep pmem as a small patchset for submission, basic
functionality, then added optional API, one by one. It is easier for review and
stages things nicely. For me I have this list here:

a2cd031 Yigal Korman            |  (HEAD, prd) prd: Add support for page struct mapping 
5f3d00e Yigal Korman            |  mm: export sparse_add/remove_one_section 
5bdf5f7 Boaz Harrosh            |  pmem: Add getgeo to block ops 
387daf9 Ross Zwisler            |  pmem: add support for rw_page() 
5629da1 Ross Zwisler            |  pmem: Initial version of Persistent RAM Driver 

The first patch, Initial version will need to have both our sign-off and
a note about a tree with full history at the github address. I've been
participating in the pnfs tree where we worked like that for 4 years with
100ds of patches.

The one thing you must not do is delete the old trees. at first you make a branch
with the SQUASHMES as is, then rebase do the squashes and produce a new clean branch.
Tag them. Farther development gets as SQUASHMEs on top, tagged rebased and so on.
Then final upstream submission notes of the public tree that has the real history.
That's the process we worked with the big companies lawyers.
Note that anyone that touched a part of any patch, will need to have his sign-off
on it, then authorship is arbitrated by content.

> - Ross
> 


Thanks
Boaz

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2014-08-21  9:47 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-13 12:08 [RFC 0/9] pmem: Support for "struct page" with Persistent Memory storage Boaz Harrosh
2014-08-13 12:10 ` [RFC 1/9] prd: Initial version of Persistent RAM Driver Boaz Harrosh
2014-08-13 12:11 ` [RFC 2/9] prd: add support for rw_page() Boaz Harrosh
2014-08-13 12:12 ` [RFC 3/9] prd: Add getgeo to block ops Boaz Harrosh
2014-08-13 12:14 ` [RFC 4/9] SQUASHME: prd: Fixs to getgeo Boaz Harrosh
2014-08-20 22:10   ` Ross Zwisler
2014-08-21  9:47     ` Boaz Harrosh [this message]
2014-08-13 12:16 ` [RFC 5/9] SQUASHME: prd: Last fixes for partitions Boaz Harrosh
2014-08-14 13:04   ` Boaz Harrosh
2014-08-14 13:16     ` Matthew Wilcox
2014-08-14 13:55       ` Boaz Harrosh
2014-08-14 13:07   ` [PATCH 5/9 v2] " Boaz Harrosh
2014-08-25 20:10     ` Ross Zwisler
2014-08-26  8:18       ` Boaz Harrosh
2014-08-26 17:36         ` Boaz Harrosh
2014-08-26 20:34           ` Ross Zwisler
2014-08-27  9:41             ` Boaz Harrosh
2014-08-27  4:38           ` Matthew Wilcox
2014-08-27  9:55             ` Boaz Harrosh
2014-08-27 12:46               ` Matthew Wilcox
2014-08-27 13:01                 ` Boaz Harrosh
2014-08-20 23:03   ` [RFC 5/9] " Ross Zwisler
2014-08-21 10:05     ` Boaz Harrosh
2014-08-13 12:18 ` [RFC 6/9] SQUASHME: prd: Let each prd-device manage private memory region Boaz Harrosh
2014-08-21 16:57   ` Ross Zwisler
2014-08-13 12:20 ` [RFC 7/9] SQUASHME: prd: Support of multiple memory regions Boaz Harrosh
2014-08-25 23:02   ` Ross Zwisler
2014-08-13 12:21 ` [RFC 8/9] mm: export sparse_add/remove_one_section Boaz Harrosh
2014-08-13 12:26 ` [RFC 9/9] prd: Add support for page struct mapping Boaz Harrosh
2014-08-15 20:28   ` Toshi Kani
2014-08-17  9:17     ` Boaz Harrosh
2014-08-18 19:48       ` Toshi Kani
2014-08-19  8:40         ` Boaz Harrosh
2014-08-19 16:49           ` Toshi Kani
2014-08-22 14:36   ` Dave Hansen
2014-09-09 16:16     ` Boaz Harrosh
2014-09-09 16:29       ` Dave Hansen
2014-08-20 20:13 ` [RFC 0/9] pmem: Support for "struct page" with Persistent Memory storage Ross Zwisler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53F5C04B.5000900@gmail.com \
    --to=openosd@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=boaz@plexistor.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ross.zwisler@linux.intel.com \
    --cc=sagi@plexistor.com \
    --cc=willy@linux.intel.com \
    --cc=yigal@plexistor.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).