linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Does the md codes can work well under SMP?
@ 2006-12-12  7:23 liyiming
  0 siblings, 0 replies; only message in thread
From: liyiming @ 2006-12-12  7:23 UTC (permalink / raw)
  To: Neil Brown; +Cc: linux-raid@vger.kernel.org


These days I devoted to reading md codes in 2.6.12_r11
I have noticed that you applied two different locking strategy in these two functions:
end_read_request:
	if (uptodate) {
		set_bit(R5_UPTODATE, &sh->dev[i].flags);	
	} else {
		md_error(conf->mddev, conf->disks[i].rdev);
		clear_bit(R5_UPTODATE, &sh->dev[i].flags);
	}
	rdev_dec_pending(conf->disks[i].rdev, conf->mddev);
	clear_bit(R5_LOCKED, &sh->dev[i].flags);
	set_bit(STRIPE_HANDLE, &sh->state);
	release_stripe(sh);
end_write_request:
	spin_lock_irqsave(&conf->device_lock, flags);
	if (!uptodate)
		md_error(conf->mddev, conf->disks[i].rdev);

	rdev_dec_pending(conf->disks[i].rdev, conf->mddev);
	
	clear_bit(R5_LOCKED, &sh->dev[i].flags);
	set_bit(STRIPE_HANDLE, &sh->state);
	__release_stripe(conf, sh);
	spin_unlock_irqrestore(&conf->device_lock, flags);


if these two function excuting on different CPU, the spin lock can work well? and why?
 				
--------------
liyiming
2006-12-12


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-12-12  7:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-12  7:23 Does the md codes can work well under SMP? liyiming

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).