From: Masayoshi MIZUMA Subject: Re: [PATCH][RFC] vfs: block_read_full_page allocates array depending on environment Date: Mon, 01 Feb 2010 17:21:07 +0900 Message-ID: <20100201172105.14DE.61FB500B@jp.fujitsu.com> References: <20100129095356.265D.61FB500B@jp.fujitsu.com> <87k4v0f72r.fsf@devron.myhome.or.jp> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Cc: Alexander Viro , linux-fsdevel@vger.kernel.org To: OGAWA Hirofumi Return-path: Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:55622 "EHLO fgwmail6.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751010Ab0BAIUd (ORCPT ); Mon, 1 Feb 2010 03:20:33 -0500 Received: from m1.gw.fujitsu.co.jp ([10.0.50.71]) by fgwmail6.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id o118KVgC016312 for (envelope-from m.mizuma@jp.fujitsu.com); Mon, 1 Feb 2010 17:20:32 +0900 Received: from smail (m1 [127.0.0.1]) by outgoing.m1.gw.fujitsu.co.jp (Postfix) with ESMTP id A5A1C45DE50 for ; Mon, 1 Feb 2010 17:20:31 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (s1.gw.fujitsu.co.jp [10.0.50.91]) by m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 77AA345DE4D for ; Mon, 1 Feb 2010 17:20:31 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id 59FD71DB8041 for ; Mon, 1 Feb 2010 17:20:31 +0900 (JST) Received: from m106.s.css.fujitsu.com (m106.s.css.fujitsu.com [10.249.87.106]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id 08FCC1DB803E for ; Mon, 1 Feb 2010 17:20:31 +0900 (JST) In-Reply-To: <87k4v0f72r.fsf@devron.myhome.or.jp> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: OGAWA Hirofumi wrote: > Masayoshi MIZUMA writes: > > > @@ -2146,13 +2146,12 @@ int block_read_full_page(struct page *page, get_block_t *get_block) > > { > > struct inode *inode = page->mapping->host; > > sector_t iblock, lblock; > > - struct buffer_head *bh, *head, *arr[MAX_BUF_PER_PAGE]; > > - unsigned int blocksize; > > + unsigned int blocksize = 1 << inode->i_blkbits; > > + struct buffer_head *bh, *head, *arr[PAGE_CACHE_SIZE / blocksize]; > > In practice, we avoid to use the variable-length array on the kernel > stack. Although I'm not sure how important it is, there are some reasons > to avoid. Also sparse will warn it, IIRC. Umm... I understand the practice itself, but is there specific reason for the practice ? If there isn't, we don't need to avoid use it, I think. Thanks, Masayoshi