From a5dfc7e967a72ec0cb7c957e85d9e86fc5906e9e Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 12 Aug 2013 23:11:04 -0700 Subject: [PATCH] 3.4-stable patches added patches: perf-tools-add-anonymous-huge-page-recognition.patch vfs-d_obtain_alias-needs-to-use-as-default-name.patch --- ...-add-anonymous-huge-page-recognition.patch | 48 ++++++++++++++++++ queue-3.4/series | 2 + ...n_alias-needs-to-use-as-default-name.patch | 50 +++++++++++++++++++ 3 files changed, 100 insertions(+) create mode 100644 queue-3.4/perf-tools-add-anonymous-huge-page-recognition.patch create mode 100644 queue-3.4/vfs-d_obtain_alias-needs-to-use-as-default-name.patch diff --git a/queue-3.4/perf-tools-add-anonymous-huge-page-recognition.patch b/queue-3.4/perf-tools-add-anonymous-huge-page-recognition.patch new file mode 100644 index 00000000000..75fbe3b806a --- /dev/null +++ b/queue-3.4/perf-tools-add-anonymous-huge-page-recognition.patch @@ -0,0 +1,48 @@ +From d0528b5d71faf612014dd7672e44225c915344b2 Mon Sep 17 00:00:00 2001 +From: Joshua Zhu +Date: Sat, 5 Jan 2013 13:29:57 +0800 +Subject: perf tools: Add anonymous huge page recognition + +From: Joshua Zhu + +commit d0528b5d71faf612014dd7672e44225c915344b2 upstream. + +Judging anonymous memory's vm_area_struct, perf_mmap_event's filename +will be set to "//anon" indicating this vma belongs to anonymous +memory. + +Once hugepage is used, vma's vm_file points to hugetlbfs. In this way, +this vma will not be regarded as anonymous memory by is_anon_memory() in +perf user space utility. + +Signed-off-by: Joshua Zhu +Cc: Akihiro Nagai +Cc: Andi Kleen +Cc: David Ahern +Cc: Ingo Molnar +Cc: Jiri Olsa +Cc: Joshua Zhu +Cc: Namhyung Kim +Cc: Paul Mackerras +Cc: Peter Zijlstra +Cc: Vinson Lee +Link: http://lkml.kernel.org/r/1357363797-3550-1-git-send-email-zhu.wen-jie@hp.com +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman + +--- + tools/perf/util/map.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/tools/perf/util/map.c ++++ b/tools/perf/util/map.c +@@ -15,7 +15,8 @@ const char *map_type__name[MAP__NR_TYPES + + static inline int is_anon_memory(const char *filename) + { +- return strcmp(filename, "//anon") == 0; ++ return !strcmp(filename, "//anon") || ++ !strcmp(filename, "/anon_hugepage (deleted)"); + } + + static inline int is_no_dso_memory(const char *filename) diff --git a/queue-3.4/series b/queue-3.4/series index c84e3c3dbd6..bed3841d8de 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -13,3 +13,5 @@ usb-core-don-t-try-to-reset_device-a-port-that-got-just-disconnected.patch debugfs-debugfs_remove_recursive-must-not-rely-on-list_empty-d_subdirs.patch tracing-fix-fields-of-struct-trace_iterator-that-are-zeroed-by-mistake.patch scsi-nsp32-use-mdelay-instead-of-large-udelay-constants.patch +vfs-d_obtain_alias-needs-to-use-as-default-name.patch +perf-tools-add-anonymous-huge-page-recognition.patch diff --git a/queue-3.4/vfs-d_obtain_alias-needs-to-use-as-default-name.patch b/queue-3.4/vfs-d_obtain_alias-needs-to-use-as-default-name.patch new file mode 100644 index 00000000000..83c365df911 --- /dev/null +++ b/queue-3.4/vfs-d_obtain_alias-needs-to-use-as-default-name.patch @@ -0,0 +1,50 @@ +From 150086ca6bd7493e7753f923a3f55e73701253b3 Mon Sep 17 00:00:00 2001 +From: NeilBrown +Date: Thu, 8 Nov 2012 16:09:37 -0800 +Subject: vfs: d_obtain_alias() needs to use "/" as default name. + +From: NeilBrown + +commit b911a6bdeef5848c468597d040e3407e0aee04ce upstream. + +NFS appears to use d_obtain_alias() to create the root dentry rather than +d_make_root. This can cause 'prepend_path()' to complain that the root +has a weird name if an NFS filesystem is lazily unmounted. e.g. if +"/mnt" is an NFS mount then + + { cd /mnt; umount -l /mnt ; ls -l /proc/self/cwd; } + +will cause a WARN message like + WARNING: at /home/git/linux/fs/dcache.c:2624 prepend_path+0x1d7/0x1e0() + ... + Root dentry has weird name <> + +to appear in kernel logs. + +So change d_obtain_alias() to use "/" rather than "" as the anonymous +name. + +Signed-off-by: NeilBrown +Cc: Trond Myklebust +Cc: Al Viro +Signed-off-by: Andrew Morton +Signed-off-by: Al Viro +[bwh: Backported to 3.2: use named initialisers instead of QSTR_INIT()] +Signed-off-by: Ben Hutchings +Signed-off-by: Greg Kroah-Hartman + +--- + fs/dcache.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/dcache.c ++++ b/fs/dcache.c +@@ -1556,7 +1556,7 @@ EXPORT_SYMBOL(d_find_any_alias); + */ + struct dentry *d_obtain_alias(struct inode *inode) + { +- static const struct qstr anonstring = { .name = "" }; ++ static const struct qstr anonstring = { .name = "/", .len = 1 }; + struct dentry *tmp; + struct dentry *res; + -- 2.47.3