svn commit: r258039 - in head/sys: kern vm

Konstantin Belousov kostikbel at gmail.com
Wed Nov 13 07:28:30 UTC 2013


On Tue, Nov 12, 2013 at 04:29:06PM -0800, John-Mark Gurney wrote:
> Bruce Evans wrote this message on Tue, Nov 12, 2013 at 22:13 +1100:
> > On Tue, 12 Nov 2013, Konstantin Belousov wrote:
> > 
> > >Log:
> > > Avoid overflow for the page counts.
> > >
> > > Reported and tested by:	pho
> > > Sponsored by:	The FreeBSD Foundation
> > > MFC after:	1 week
> > 
> > >Modified: head/sys/kern/vfs_vnops.c
> > >==============================================================================
> > >--- head/sys/kern/vfs_vnops.c	Tue Nov 12 08:32:10 2013	(r258038)
> > >+++ head/sys/kern/vfs_vnops.c	Tue Nov 12 08:47:58 2013	(r258039)
> > >@@ -933,8 +933,9 @@ vn_io_fault(struct file *fp, struct uio
> > >	void *rl_cookie;
> > >	struct mount *mp;
> > >	vm_page_t *prev_td_ma;
> > >-	int cnt, error, save, saveheld, prev_td_ma_cnt;
> > >+	int error, save, saveheld, prev_td_ma_cnt;
> > >	vm_offset_t addr, end;
> > >+	vm_size_t cnt;
> > 
> > int was correct for a count.  You can't possibly have the 8TB
> > of physical memory needed to overflow a 32-bit int page count.
>                     ^ today
> > It is reasonably to assume 32-bit ints.
> 
> Except that the modern AMD64 arch now allows 52 bits of address for
> phyiscal memory, which does mean in a few years, we will be eclipsing
> 8TB in a single machine...
> 
> Isn't someone running FreeBSD on a 1TB machine?  I'm pretty possitive
> I remeber someone running 512GB, so only 3/4 doublings away from hitting
> the limit...

The variable in question has no relation to the physical memory size.
I already noted to Bruce, in the private reply, that the variable must
hold the count of the page frames covering the i/o request.  As such,
it must be sized to be able to hold the page count for the whole address
space.

The variable is clamped later, but this is an implementation detail.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20131113/c59c3f92/attachment.sig>


More information about the svn-src-head mailing list