From owner-p4-projects@FreeBSD.ORG Fri Oct 21 19:25:54 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9D8F51065674; Fri, 21 Oct 2011 19:25:54 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60283106566C for ; Fri, 21 Oct 2011 19:25:54 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 4D7D48FC0C for ; Fri, 21 Oct 2011 19:25:54 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p9LJPslF062052 for ; Fri, 21 Oct 2011 19:25:54 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p9LJPsvZ062049 for perforce@freebsd.org; Fri, 21 Oct 2011 19:25:54 GMT (envelope-from jhb@freebsd.org) Date: Fri, 21 Oct 2011 19:25:54 GMT Message-Id: <201110211925.p9LJPsvZ062049@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 200538 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2011 19:25:54 -0000 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 #include #include -#include #include #include #include @@ -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: