KernelNewbies
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Kernel Hacking

  • Frontpage

  • Kernel Hacking

  • Kernel Documentation

  • Kernel Glossary

  • FAQ

  • Found a bug?

  • Kernel Changelog

  • Upstream Merge Guide

Projects

  • KernelJanitors

  • KernelMentors

  • KernelProjects

Community

  • Why a community?

  • Regional Kernelnewbies

  • Personal Pages

  • Upcoming Events

References

  • Mailing Lists

  • Related Sites

  • Programming Links

Wiki

  • Recent Changes

  • Site Editors

  • Side Bar

  • Tips for Editors

  • Hosted by WikiWall

Navigation

  • RecentChanges
  • FindPage
  • HelpContents

Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment

Revision 3 as of 2008-11-22 12:13:33
KernelNewbies:
  • KernelProjects
  • Raid1ReadBalancing

RAID1 is a simple RAID mode, storing data on multiple hard drives to increase reliability. RAID1 slows down disk writes because data needs to be written to multiple drives, but it has the potential to speed up reads because a read could be done from any drive. Looking at drivers/md/dm-raid1.c it seems that Linux does not implement this yet:

static struct mirror *choose_mirror(struct mirror_set *ms, sector_t sector)
{
        /* FIXME: add read balancing */
        return ms->default_mirror;
}

For bonus points, figure out a really intelligent way to choose the mirror, using factors such as:

  • Sequential IO is fast, so a read adjacant to a previous one should maybe go to the same disk.
  • A RAID1 volume could be only part of the disk, maybe the disk has other requests in the queue and we should pick the least busy disk?
  • Power saving. When the system is nearly idle and only doing reads, maybe one disk could be spun down, with all requests going to the other disk?

RAID1 read balancing was added in 2.6.25: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=06386bbfd2441416875d0403d405c56822f6ebac

Difficulty: 4

  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01