- fix ppc64/x86_64 spec to use %{_libdir} instead of /usr/lib (5389)
- remove ancient LOV_MAGIC_V0 EA support (5047)
- add "disk I/Os in flight" and "I/O req time" stats in obdfilter
+ - allow readahead allocations to fail when low on memory (5383)
2004-11-23 Cluster File Systems, Inc. <info@clusterfs.com>
* version 1.4.0
])
#
+# LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP
+#
+# check for our patched grab_cache_page_nowait_gfp() function
+#
+AC_DEFUN([LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP],
+[
+LB_LINUX_TRY_COMPILE([
+ #include <linux/pagemap.h>
+],[
+ grab_cache_page_nowait_gfp(NULL, 0, 0);
+],[
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_GRAB_CACHE_PAGE_NOWAIT_GFP, 1,
+ [kernel has grab_cache_page_nowait_gfp()])
+],[
+ AC_MSG_RESULT([no])
+])])
+
+#
# LC_CONFIG_BACKINGFS
#
# whether to use extN or ldiskfs instead of ext3
LC_HEADER_MM_INLINE
LC_STRUCT_INODE
LC_FUNC_REGISTER_CACHE
+LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP
])
#
#define MDS_PACK_MD_LOCK 0
#endif
+#ifndef HAVE_GRAB_CACHE_PAGE_NOWAIT_GFP
+#define grab_cache_page_nowait_gfp(x, y, z) (grab_cache_page_nowait((x), (y)))
+#endif
+
#endif /* __KERNEL__ */
#endif /* _COMPAT25_H */
--- /dev/null
+Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/mm/filemap.c
+===================================================================
+--- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/mm/filemap.c 2004-11-11 10:28:45.000000000 -0500
++++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/mm/filemap.c 2005-02-01 01:36:08.000000000 -0500
+@@ -773,8 +773,19 @@
+ struct page *
+ grab_cache_page_nowait(struct address_space *mapping, unsigned long index)
+ {
++ return grab_cache_page_nowait_gfp(mapping, index,
++ mapping_gfp_mask(mapping) &
++ ~__GFP_FS);
++}
++
++EXPORT_SYMBOL(grab_cache_page_nowait);
++
++struct page *
++grab_cache_page_nowait_gfp(struct address_space *mapping,
++ unsigned long index,
++ unsigned int gfp_mask)
++{
+ struct page *page = find_get_page(mapping, index);
+- int gfp_mask;
+
+ if (page) {
+ if (!TestSetPageLocked(page))
+@@ -782,7 +793,7 @@
+ page_cache_release(page);
+ return NULL;
+ }
+- gfp_mask = mapping_gfp_mask(mapping) & ~__GFP_FS;
++
+ page = alloc_pages(gfp_mask, 0);
+ if (page && add_to_page_cache_lru(page, mapping, index, gfp_mask)) {
+ page_cache_release(page);
+@@ -791,7 +802,7 @@
+ return page;
+ }
+
+-EXPORT_SYMBOL(grab_cache_page_nowait);
++EXPORT_SYMBOL(grab_cache_page_nowait_gfp);
+
+ /*
+ * This is a generic file read routine, and uses the
+Index: linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/pagemap.h
+===================================================================
+--- linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891.orig/include/linux/pagemap.h 2004-11-11 10:28:43.000000000 -0500
++++ linux-2.6.5-SLES9_SP1_BRANCH_2004111114454891/include/linux/pagemap.h 2005-02-01 01:29:06.000000000 -0500
+@@ -92,6 +92,9 @@
+
+ extern struct page * grab_cache_page_nowait(struct address_space *mapping,
+ unsigned long index);
++extern struct page * grab_cache_page_nowait_gfp(struct address_space *mapping,
++ unsigned long index,
++ unsigned int gfp_mask);
+ extern struct page * read_cache_page(struct address_space *mapping,
+ unsigned long index, filler_t *filler,
+ void *data);
--- /dev/null
+Index: linux-2.4.20/mm/filemap.c
+===================================================================
+--- linux-2.4.20.orig/mm/filemap.c 2004-12-17 17:51:44.000000000 -0500
++++ linux-2.4.20/mm/filemap.c 2004-12-17 17:56:54.000000000 -0500
+@@ -1153,6 +1153,14 @@
+ */
+ struct page *grab_cache_page_nowait(struct address_space *mapping, unsigned long index)
+ {
++ return grab_cache_page_nowait_gfp(mapping, index, mapping->gfp_mask);
++}
++
++
++struct page *grab_cache_page_nowait_gfp(struct address_space *mapping,
++ unsigned long index,
++ unsigned int gfp_mask)
++{
+ struct page *page, **hash;
+
+ hash = page_hash(mapping, index);
+@@ -1177,7 +1185,7 @@
+ }
+ }
+
+- page = page_cache_alloc(mapping);
++ page = alloc_pages(gfp_mask, 0);
+ if ( unlikely(!page) )
+ return NULL; /* Failed to allocate a page */
+
+Index: linux-2.4.20/mm/page_alloc.c
+===================================================================
+--- linux-2.4.20.orig/mm/page_alloc.c 2004-12-17 17:51:30.000000000 -0500
++++ linux-2.4.20/mm/page_alloc.c 2004-12-17 18:26:45.000000000 -0500
+@@ -547,6 +547,8 @@
+ */
+ return NULL;
+ }
++ } else if (!(gfp_mask & __GFP_HIGH)) {
++ return NULL;
+ }
+ }
+
+Index: linux-2.4.20/kernel/ksyms.c
+===================================================================
+--- linux-2.4.20.orig/kernel/ksyms.c 2004-12-17 17:51:46.000000000 -0500
++++ linux-2.4.20/kernel/ksyms.c 2004-12-17 17:52:59.000000000 -0500
+@@ -300,6 +300,7 @@
+ EXPORT_SYMBOL(__find_lock_page);
+ EXPORT_SYMBOL(find_or_create_page);
+ EXPORT_SYMBOL(grab_cache_page_nowait);
++EXPORT_SYMBOL(grab_cache_page_nowait_gfp);
+ EXPORT_SYMBOL(read_cache_page);
+ EXPORT_SYMBOL(set_page_dirty);
+ EXPORT_SYMBOL(vfs_readlink);
+Index: linux-2.4.20/include/linux/pagemap.h
+===================================================================
+--- linux-2.4.20.orig/include/linux/pagemap.h 2004-05-27 14:25:05.000000000 -0400
++++ linux-2.4.20/include/linux/pagemap.h 2004-12-17 18:11:09.000000000 -0500
+@@ -110,6 +110,7 @@
+
+
+ extern struct page * grab_cache_page_nowait (struct address_space *, unsigned long);
++extern struct page * grab_cache_page_nowait_gfp (struct address_space *, unsigned long, unsigned int);
+
+ typedef int filler_t(void *, struct page*);
+
perfctr-2.6-suse-lnxi.patch
kexec-2.6-suse-lnxi.patch
brk-locked-2.6-suse-lnxi.patch
+grab_cache_page_nowait_gfp-2.6-suse.patch
x86-fpu-crash.patch
export-show_task-2.4-rh.patch
export-zap-page-range.patch
+grab_cache_page_nowait_gfp-rh-2.4.patch
llnl-frame-pointer-walk-fix-2.4.21-rhel.patch
export-show_task-2.4-rhel.patch
compile-fixes-2.4.21-rhel.patch
+grab_cache_page_nowait_gfp-rh-2.4.patch
struct page *page;
int rc, ret = 0, match_failed = 0;
__u64 kms;
+ unsigned int gfp_mask;
ENTRY;
kms = lov_merge_size(ll_i2info(mapping->host)->lli_smd, 1);
if (reserved < end - start + 1)
ll_ra_stats_inc(mapping, RA_STAT_MAX_IN_FLIGHT);
+ gfp_mask = GFP_HIGHUSER & ~__GFP_WAIT;
+#ifdef __GFP_NOWARN
+ gfp_mask |= __GFP_NOWARN;
+#endif
+
for (i = start; reserved > 0 && !match_failed && i <= end; i++) {
/* skip locked pages from previous readpage calls */
- page = grab_cache_page_nowait(mapping, i);
+ page = grab_cache_page_nowait_gfp(mapping, i, gfp_mask);
if (page == NULL) {
CDEBUG(D_READA, "g_c_p_n failed\n");
continue;