Sorry for the dumb question, I noticed that in the function blkfront.c: blkif_queue_request(...), there are these two lines of codes: ---------------------------- if ( lsect > 7 ) BUG(); ---------------------------- I guess lsect stands for last sector, but I don''t understand why last sector greater than 7 indicates a bug. Any reason for this? Thanks, Xin ------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
It''s a while since I looked at this stuff. Off the top of my head, however: is 7 the limit on the number of sectors that can be queued in one block request? If that''s not it, I expect someone will have a proper answer in the morning. Off to sleep now.... HTH, Mark On Tuesday 28 September 2004 03:00, Xin Zhao wrote:> Sorry for the dumb question, > > I noticed that in the function blkfront.c: blkif_queue_request(...), there > are these two lines of codes: > > ---------------------------- > if ( lsect > 7 ) > BUG(); > ---------------------------- > > I guess lsect stands for last sector, but I don''t understand why last > sector greater than 7 indicates a bug. > > Any reason for this? > > Thanks, > Xin > > > ------------------------------------------------------- > This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 > Project Admins to receive an Apple iPod Mini FREE for your judgement on > who ports your project to Linux PPC the best. Sponsored by IBM. > Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/xen-devel------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
> Sorry for the dumb question, > > I noticed that in the function blkfront.c: blkif_queue_request(...), there > are these two lines of codes: > > ---------------------------- > if ( lsect > 7 ) > BUG(); > ----------------------------Disk sectors are 512 bytes, pages 4096 bytes, hence you can have runs of up to 8 sectors in a page. At the point that queue_request is called we know that the request will fit entirely within a page. It''s the job of this function to merge requests that are to sequential areas of disk into in a single scatter gather list. Ian ------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
If lsect stands for the number of sector to be transferred, your explanation is reasonable, but the following two lines give me an impression that lsect is the index of the last sector to be transferred: --------------------------------- fsect = (buffer_ma & ~PAGE_MASK) >> 9; lsect = fsect + nr_sectors - 1; ----------------------------------- The sector index does not have to be less than 8, right? Am I wrong in understanding the codes? Thanks for your help. Xin On Tue, 28 Sep 2004, Ian Pratt wrote:> > Sorry for the dumb question, > > > > I noticed that in the function blkfront.c: blkif_queue_request(...), there > > are these two lines of codes: > > > > ---------------------------- > > if ( lsect > 7 ) > > BUG(); > > ---------------------------- > > Disk sectors are 512 bytes, pages 4096 bytes, hence you can have > runs of up to 8 sectors in a page. At the point that > queue_request is called we know that the request will fit > entirely within a page. It''s the job of this function to merge > requests that are to sequential areas of disk into in a single > scatter gather list. > > Ian >------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
The extent has to fit within an aligned page. ''fsect'' and ''lsect'' denote the first and last sectors, inclusive, within a page. Since we count from zero, the minimum permissible value for fsect is 0 and for lsect is 7. Hence the assertion. -- Keir> If lsect stands for the number of sector to be transferred, your > explanation is reasonable, but the following two lines give me an > impression that lsect is the index of the last sector to be transferred: > > --------------------------------- > fsect = (buffer_ma & ~PAGE_MASK) >> 9; > lsect = fsect + nr_sectors - 1; > ----------------------------------- > > The sector index does not have to be less than 8, right? Am I wrong in > understanding the codes? > > Thanks for your help. > > Xin > > On Tue, 28 Sep 2004, Ian Pratt wrote: > > > > Sorry for the dumb question, > > > > > > I noticed that in the function blkfront.c: blkif_queue_request(...), there > > > are these two lines of codes: > > > > > > ---------------------------- > > > if ( lsect > 7 ) > > > BUG(); > > > ---------------------------- > > > > Disk sectors are 512 bytes, pages 4096 bytes, hence you can have > > runs of up to 8 sectors in a page. At the point that > > queue_request is called we know that the request will fit > > entirely within a page. It''s the job of this function to merge > > requests that are to sequential areas of disk into in a single > > scatter gather list. > > > > Ian > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 > Project Admins to receive an Apple iPod Mini FREE for your judgement on > who ports your project to Linux PPC the best. Sponsored by IBM. > Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/xen-devel------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
> If lsect stands for the number of sector to be transferred, your > explanation is reasonable, but the following two lines give me an > impression that lsect is the index of the last sector to be transferred: > > --------------------------------- > fsect = (buffer_ma & ~PAGE_MASK) >> 9; > lsect = fsect + nr_sectors - 1; > ----------------------------------- > > The sector index does not have to be less than 8, right? Am I wrong in > understanding the codes?fsect is the first sector, lsect is the last sector. 0 <= fsect <= lsect <= 7 I stand by my explanation. Ian ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
I got the point. It''s my misunderstanding. I guess fsect and lsect really denotes the first and last sector number WITHIN ONE PAGE. That will make more sense. Thanks again for your kind explanation. Xin Thanks a lot for your explanation. On Tue, 28 Sep 2004, Keir Fraser wrote:> > The extent has to fit within an aligned page. ''fsect'' and ''lsect'' > denote the first and last sectors, inclusive, within a page. > > Since we count from zero, the minimum permissible value for fsect is 0 > and for lsect is 7. Hence the assertion. > > -- Keir > > > > If lsect stands for the number of sector to be transferred, your > > explanation is reasonable, but the following two lines give me an > > impression that lsect is the index of the last sector to be transferred: > > > > --------------------------------- > > fsect = (buffer_ma & ~PAGE_MASK) >> 9; > > lsect = fsect + nr_sectors - 1; > > ----------------------------------- > > > > The sector index does not have to be less than 8, right? Am I wrong in > > understanding the codes? > > > > Thanks for your help. > > > > Xin > > > > On Tue, 28 Sep 2004, Ian Pratt wrote: > > > > > > Sorry for the dumb question, > > > > > > > > I noticed that in the function blkfront.c: blkif_queue_request(...), there > > > > are these two lines of codes: > > > > > > > > ---------------------------- > > > > if ( lsect > 7 ) > > > > BUG(); > > > > ---------------------------- > > > > > > Disk sectors are 512 bytes, pages 4096 bytes, hence you can have > > > runs of up to 8 sectors in a page. At the point that > > > queue_request is called we know that the request will fit > > > entirely within a page. It''s the job of this function to merge > > > requests that are to sequential areas of disk into in a single > > > scatter gather list. > > > > > > Ian > > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 > > Project Admins to receive an Apple iPod Mini FREE for your judgement on > > who ports your project to Linux PPC the best. Sponsored by IBM. > > Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php > > _______________________________________________ > > Xen-devel mailing list > > Xen-devel@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/xen-devel >------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel