| To: | Timothy Shimmin <tes@xxxxxxx> |
|---|---|
| Subject: | Re: Unexpected xfs_buf_item_init initialization and inflexible xfs_buf_item_zone |
| From: | Shailendra Tripathi <stripathi@xxxxxxxxx> |
| Date: | Wed, 11 Jan 2006 16:29:59 +0530 |
| Cc: | linux-xfs@xxxxxxxxxxx |
| In-reply-to: | <43C4BFAF.1060507@sgi.com> |
| References: | <14BC3454F4B4614FBC4F3FB19A84C372050C5F@FPNYEXCBE01.opus-i.corp> <43BA04AF.2060703@agami.com> <43C4BFAF.1060507@sgi.com> |
| Sender: | linux-xfs-bounce@xxxxxxxxxxx |
| User-agent: | Mozilla Thunderbird 0.9 (X11/20041127) |
Hi Tim,
Thanks so much for the response. Comments inlined.
Yes I agree, that the map_size is going to be unnecessarily large Given that the chunks calculation relies on buf count (not on page count), this extra addition appears mandatory. So, it appears that it has been intentionally set to extra one to compensate its usage along with buf count. If non-aligned (non 4k aligned) request for full 64K buffer comes in xfs_trans_read_buf, the buffer actually created may be of higher size as buffers are created in multiples of PAGE_SIZE (4k). For example, if xfs_buf_get_flags gets ioff= 2K, and length is 16 blocks(4k), the buffer created will be of 17 pages. Hence, the dirtied chunks can be in 17th page as well. The chunks calculated here should be for complete buffer (not the allocation request) as this is what logging code will finally see (it does not know the original request) and the maps will account for the complete buffer (first 2k as well). However, chunks & map calculated using buf count will only suffice for 16 pages. This forces to have the map_size off by 1. chunks = (int)((XFS_BUF_COUNT(bp) + (XFS_BLI_CHUNK - 1)) >> XFS_BLI_SHIFT); map_size = (int)((chunks + NBWORD) >> BIT_TO_WORD_SHIFT); Isn't understanding this will be far more easier if (and logically more correct?) if it would have been chunks = (int)((XFS_PAGE_COUNT(bp) (XFS_BLI_CHUNK - 1)) >> XFS_BLI_SHIFT); and map_size = (int)((chunks + NBWORD -1) >> BIT_TO_WORD_SHIFT); I realize now the current code is correct, however, it took me a while to figure out this indirect relation. When I changed the map_size calculation to correct it, I got "unable to handle page request" because of the above chunks calculation. And, the second part which I was interested to know was (not very clear in my mail) as to where from this XFS_MAX_BLOCKSIZE comes and how buf log item code is dependent upon this. I am unable to get the correlation between this size and the max buffer size. To be precise, can I figure what is the maximum size of a buf item which can be created with the block size of 4k (or what is the maximum number of pages which can be dirtied in any transaction in worst case). If it is dependent upon blocksize, why not to make the buf_item_zone initialization dependent upon the blocksize someway to avoid the wastage of space. It is really significant if the number of inodes supported on the system is high. (If it can be avoided, it can be an icing on cake). xfs_buf_item_zone =
kmem_zone_init((sizeof(xfs_buf_log_item_t) +
(((XFS_MAX_BLOCKSIZE / XFS_BLI_CHUNK) /
NBWORD) * sizeof(int))),
"xfs_buf_item");I also need to know this because I have changed the size of the inode allocated at once from 64 inodes to full stripe width allocation. I noticed that I have been crossing the 16 + 1 page limit. I allocate an ad hoc higher number to avoid this. This creates more wastage of space. Alternatively, I will have to go for dynamic allocation of maps which may be costlier as the comment above this initialization says so. -shailendra Some concerns that spring to mind: |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: Unexpected xfs_buf_item_init initialization and inflexible xfs_buf_item_zone, Timothy Shimmin |
|---|---|
| Next by Date: | TAKE 947953 - fix follow_link, Nathan Scott |
| Previous by Thread: | Re: Unexpected xfs_buf_item_init initialization and inflexible xfs_buf_item_zone, Timothy Shimmin |
| Next by Thread: | Re: Unexpected xfs_buf_item_init initialization and inflexible xfs_buf_item_zone, Shailendra Tripathi |
| Indexes: | [Date] [Thread] [Top] [All Lists] |