Re: [PATCH] mm: fix cpu hangs on truncating last page of a 16t sparse file

2015-09-28 Thread Hugh Dickins
On Mon, 28 Sep 2015, Andi Kleen wrote: > > I can't tell you why MAX_LFS_FILESIZE was defined to exclude half > > of the available range. I've always assumed that it's because there > > were known or feared areas of the code, which manipulate between > > bytes and pages, and might hit sign extensi

Re: [PATCH] mm: fix cpu hangs on truncating last page of a 16t sparse file

2015-09-28 Thread Andi Kleen
> I can't tell you why MAX_LFS_FILESIZE was defined to exclude half > of the available range. I've always assumed that it's because there > were known or feared areas of the code, which manipulate between > bytes and pages, and might hit sign extension issues - though > I cannot identify those pla

Re: [PATCH] mm: fix cpu hangs on truncating last page of a 16t sparse file

2015-09-27 Thread Dave Chinner
On Sun, Sep 27, 2015 at 07:56:55PM -0400, Jeff Layton wrote: > On Mon, 28 Sep 2015 09:26:45 +1000 Dave Chinner wrote: > > On Sun, Sep 27, 2015 at 10:59:33AM -0700, Hugh Dickins wrote: > > > > But if s_maxbytes doesn't have to be greater than MAX_LFS_FILESIZE, > > > > i agree the issue should be fi

Re: [PATCH] mm: fix cpu hangs on truncating last page of a 16t sparse file

2015-09-27 Thread Jeff Layton
On Mon, 28 Sep 2015 09:26:45 +1000 Dave Chinner wrote: > On Sun, Sep 27, 2015 at 10:59:33AM -0700, Hugh Dickins wrote: > > On Sun, 27 Sep 2015, angelo wrote: > > > On 27/09/2015 03:36, Hugh Dickins wrote: > > > > Let's Cc linux-fsdevel, who will be more knowledgable. > > > > > > > > On Sun, 27 S

Re: [PATCH] mm: fix cpu hangs on truncating last page of a 16t sparse file

2015-09-27 Thread Dave Chinner
On Sun, Sep 27, 2015 at 10:59:33AM -0700, Hugh Dickins wrote: > On Sun, 27 Sep 2015, angelo wrote: > > On 27/09/2015 03:36, Hugh Dickins wrote: > > > Let's Cc linux-fsdevel, who will be more knowledgable. > > > > > > On Sun, 27 Sep 2015, angelo wrote: > > > > > > > Hi all, > > > > > > > > runnin

Re: [PATCH] mm: fix cpu hangs on truncating last page of a 16t sparse file

2015-09-27 Thread Hugh Dickins
On Sun, 27 Sep 2015, angelo wrote: > On 27/09/2015 03:36, Hugh Dickins wrote: > > Let's Cc linux-fsdevel, who will be more knowledgable. > > > > On Sun, 27 Sep 2015, angelo wrote: > > > > > Hi all, > > > > > > running xfstests, generic 308 on whatever 32bit arch is possible > > > to observe cpu

Re: [PATCH] mm: fix cpu hangs on truncating last page of a 16t sparse file

2015-09-26 Thread angelo
Hi Hugh, thanks for the fast reply.. Looks like the XFS file system can support files until 16 Tera when CONFIG_LBDAF is enabled. On XFS, 32 bit arch, s_maxbytes is actually set (CONFIG_LBDAF=y) as 17592186044415. But if s_maxbytes doesn't have to be greater than MAX_LFS_FILESIZE, i agree the

Re: [PATCH] mm: fix cpu hangs on truncating last page of a 16t sparse file

2015-09-26 Thread angelo
Hi Hugh, thanks for the fast reply.. Looks like the XFS file system can support files until 16 Tera when CONFIG_LBDAF is enabled. On XFS, 32 bit arch, s_maxbytes is actually set (CONFIG_LBDAF=y) as 17592186044415. But if s_maxbytes doesn't have to be greater than MAX_LFS_FILESIZE, i agree the

Re: [PATCH] mm: fix cpu hangs on truncating last page of a 16t sparse file

2015-09-26 Thread Hugh Dickins
Let's Cc linux-fsdevel, who will be more knowledgable. On Sun, 27 Sep 2015, angelo wrote: > Hi all, > > running xfstests, generic 308 on whatever 32bit arch is possible > to observe cpu to hang near 100% on unlink. > The test removes a sparse file of length 16tera where only the last > 4096 byte

[PATCH] mm: fix cpu hangs on truncating last page of a 16t sparse file

2015-09-26 Thread angelo
Hi all, running xfstests, generic 308 on whatever 32bit arch is possible to observe cpu to hang near 100% on unlink. The test removes a sparse file of length 16tera where only the last 4096 bytes block is mapped. At line 265 of truncate.c there is a if (index >= end) break; But if index is, a