Linux RAID subsystem development
 help / color / mirror / Atom feed
* RFC: Removal of hash table for Linear RAID
@ 2009-05-17  6:10 SandeepKsinha
  2009-05-17  7:07 ` Neil Brown
  0 siblings, 1 reply; 3+ messages in thread
From: SandeepKsinha @ 2009-05-17  6:10 UTC (permalink / raw)
  To: Linux RAID

Hi all,

I suggest the removal of the hashing table and various other members
associated with it from the struct linear_private_data, which are used
majorly for faster searching of devices.

struct linear_private_data
  {
          struct linear_private_data *prev;       /* earlier version */
-          dev_info_t              **hash_table;
-          sector_t                spacing;
          sector_t                array_sectors;
-          int                     sector_shift;   /* shift before dividing
-                                                  * by spacing
-                                                   */
          dev_info_t              disks[0];
  };



The reason for the same being that use of sector_div, spacing and
sector_shift involves lots of computations, which can be easily
avoided and we can achieve the same in a simpler way.

Also, in an environment where we hold a restriction to have a maximum
of 27 devices. I believe that a linear search would be faster or
atleast equal in time, if you take into consider the (time taken for
computations + search) while using the hash table as well.

Other than making the code simpler, IMO, this should also help shrink
the struct linear_private_data which might further help caching as
well.

Another enhancement to this can be to add a new member "nr_devices" (
number of devices ) to struct linear_private_data and use the same to
perform a binary search for the lokkup, as we know the sectors would
always be increasing as per we move ahead with devices.

Something like,

struct linear_private_data
  {
          struct linear_private_data *prev;       /* earlier version */
          sector_t                array_sectors;
          int                        nr_devices;
          dev_info_t              disks[0];
  };


And accordingly, which_dev( ) can use the same to make the search
faster and better.


Comments/suggestions please.

-- 
Regards,
Sandeep.





 	
“To learn is to change. Education is a process that changes the learner.”
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2009-05-17 12:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-17  6:10 RFC: Removal of hash table for Linear RAID SandeepKsinha
2009-05-17  7:07 ` Neil Brown
2009-05-17 12:53   ` SandeepKsinha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox