linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: Ankur Bose <ankur.bose@oracle.com>, linux-raid@vger.kernel.org
Cc: Suresh Babu Kandukuru <suresh.babu.kandukuru@oracle.com>
Subject: RE: Scalability of MD raid 1  mirror devices
Date: Fri, 16 Oct 2015 12:11:35 +1100	[thread overview]
Message-ID: <87vba7vcqg.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <9b3ee99a-b29d-4e3f-8fba-a8346c3196ea@default>

[-- Attachment #1: Type: text/plain, Size: 4307 bytes --]

Ankur Bose <ankur.bose@oracle.com> writes:

> Hi, it seems like this is very active group , I don't see any reason why anyone is not replying to the below mail.
>  
>
> Kindly reply we are in middle of something.

We are all in the middle of something.


>
> Thanks,
> ankur.
> -----Original Message-----
> From: Suresh Babu Kandukuru 
> Sent: 12 October 2015 17:34
> To: linux-raid@vger.kernel.org; neilb@suse.de
> Subject: Scalability of MD raid 1 mirror devices
>
>
> Dear Group,
>
> We are doing scalability of MD raid 1  mirror devices on the Linux host running the 3.17.2 .   we see the number of RAID 1 devices limited to 128 in one case and 511 in another case .  we would like to know why this limitation ?. Appreciate any kind of inputs and pointers 
>
> We can create the RAID 1 device in 3 ways.
>
> 1.  /dev/mdX   -> here X is the number, we can specify from 0 to 511.
> 2. /dev/md/X  -> here also X is a number from 0 to 511. It creates it as a link to the actual device /dev/mdX. ( similar to above but creates a link also).
> 3. /dev/md/”name”  -> This creates a link to actual device, whichever is free starting from 127 to 0. Below is the function which is responsible for it.
>
> char *find_free_devnm(int use_partitions) {
>         static char devnm[32];
>         int devnum;
>         for (devnum = 127; devnum != 128;  devnum = devnum ? devnum-1 : (1<<20)-1) {
>
>                 if (use_partitions)
>                         sprintf(devnm, "md_d%d", devnum);
>                 else
>                         sprintf(devnm, "md%d", devnum);
>                 if (mddev_busy(devnm))
>                         continue;
>                 if (!conf_name_is_free(devnm))
>                         continue;
>                 if (!use_udev()) {
>                         /* make sure it is new to /dev too, at least as a
>                          * non-standard */
>                         int devid = devnm2devid(devnm);
>                         if (devid) {
>                                 char *dn = map_dev(major(devid),
>                                                    minor(devid), 0);
>                                 if (dn && ! is_standard(dn, NULL))
>                                         continue;
>                         }
>                 }
>                 break;
>         }
>         if (devnum == 128)
>                 return NULL;
>         return devnm;
> }
>
> So ideally we should not create a device which is more than 128 { The
> program may crash }.

Please explain why you think the program would crash?


>
> Then we  tried to find how we are able to create up to 511 and why it is failing after that.
>
> int dev_open(char *dev, int flags)
>
> inside this function 
>
> fd = open(dev, flags);  / this line is assigning fd to -1 , which is causing the program to fail. So I wrote a simple program to crosscheck it.
>
> int main(){
>
>         char devname[32] = "/dev/hello1";
>
> // The flags I have set according to the code.
>
>         int flags = O_RDWR;
>         flags |= O_DIRECT;
>         if (mknod(devname, S_IFBLK|0600, makedev(9,511)) == 0) {
>
>                 int  fd = open(devname, flags);
>                 cout<<fd<<endl;
>                 unlink(devname);
>
>         }
> }
>
> So if the minor number is more than 511, the “fd” is assigned to -1,
> if it is in the range of 0 to 511 It is working fine.

Hmmm... you are right.
Probably due to this:

	blk_register_region(MKDEV(MD_MAJOR, 0), 512, THIS_MODULE,
			    md_probe, NULL, NULL);

Try changing the "512" to "1<<MINORBITS".


NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

  reply	other threads:[~2015-10-16  1:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <98ad0e44-1ac1-4451-a3d3-0a48f3a1d9e7@default>
2015-10-12 12:03 ` Scalability of MD raid 1 mirror devices Suresh Babu Kandukuru
2015-10-15  9:04   ` Ankur Bose
2015-10-16  1:11     ` Neil Brown [this message]
2015-10-16  2:29       ` Neil Brown

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=87vba7vcqg.fsf@notabene.neil.brown.name \
    --to=neilb@suse.de \
    --cc=ankur.bose@oracle.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=suresh.babu.kandukuru@oracle.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).