Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Oct 2011 19:25:54 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 200538 for review
Message-ID:  <201110211925.p9LJPsvZ062049@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@200538?ac=10

Change 200538 by jhb@jhb_jhbbsd on 2011/10/21 19:25:05

	Drop the default FADV_WILLNEED implementation as it doesn't
	really work and marking any pages that happen to be in RAM as
	active isn't really the right approach either.  Instead, punt
	and require each FS to implement this.

Affected files ...

.. //depot/projects/fadvise/sys/kern/vfs_default.c#3 edit

Differences ...

==== //depot/projects/fadvise/sys/kern/vfs_default.c#3 (text+ko) ====

@@ -46,7 +46,6 @@
 #include <sys/lock.h>
 #include <sys/lockf.h>
 #include <sys/malloc.h>
-#include <sys/mman.h>
 #include <sys/mount.h>
 #include <sys/mutex.h>
 #include <sys/namei.h>
@@ -997,20 +996,10 @@
 	switch (ap->a_advice) {
 	case FADV_WILLNEED:
 		/*
-		 * Apply the request to the backing VM object.
-		 *
-		 * XXX: madvise(MADV_WILLNEED) will not do readahead on
-		 * a file, perhaps FADV_WILLNEED should.
+		 * Do nothing for now.  Filesystems should provide a
+		 * custom method which starts an asynchronous read of
+		 * the requested region.
 		 */
-		start = trunc_page(ap->a_start);
-		end = round_page(ap->a_end);
-		vfslocked = VFS_LOCK_GIANT(vp->v_mount);
-		vn_lock(vp, LK_SHARED | LK_RETRY);
-		if (vp->v_object != NULL)
-			vm_object_madvise(vp->v_object, OFF_TO_IDX(start),
-			    atop(end - start), MADV_WILLNEED);
-		VOP_UNLOCK(vp, 0);
-		VFS_UNLOCK_GIANT(vfslocked);
 		error = 0;
 		break;
 	case FADV_DONTNEED:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110211925.p9LJPsvZ062049>