--- /dev/null
+From d0528b5d71faf612014dd7672e44225c915344b2 Mon Sep 17 00:00:00 2001
+From: Joshua Zhu <zhu.wen-jie@hp.com>
+Date: Sat, 5 Jan 2013 13:29:57 +0800
+Subject: perf tools: Add anonymous huge page recognition
+
+From: Joshua Zhu <zhu.wen-jie@hp.com>
+
+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 <zhu.wen-jie@hp.com>
+Cc: Akihiro Nagai <akihiro.nagai.hw@hitachi.com>
+Cc: Andi Kleen <andi@firstfloor.org>
+Cc: David Ahern <dsahern@gmail.com>
+Cc: Ingo Molnar <mingo@redhat.com>
+Cc: Jiri Olsa <jolsa@redhat.com>
+Cc: Joshua Zhu <zhu.wen-jie@hp.com>
+Cc: Namhyung Kim <namhyung@kernel.org>
+Cc: Paul Mackerras <paulus@samba.org>
+Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
+Cc: Vinson Lee <vlee@freedesktop.org>
+Link: http://lkml.kernel.org/r/1357363797-3550-1-git-send-email-zhu.wen-jie@hp.com
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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)
--- /dev/null
+From 150086ca6bd7493e7753f923a3f55e73701253b3 Mon Sep 17 00:00:00 2001
+From: NeilBrown <neilb@suse.de>
+Date: Thu, 8 Nov 2012 16:09:37 -0800
+Subject: vfs: d_obtain_alias() needs to use "/" as default name.
+
+From: NeilBrown <neilb@suse.de>
+
+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 <neilb@suse.de>
+Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
+Cc: Al Viro <viro@zeniv.linux.org.uk>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
+[bwh: Backported to 3.2: use named initialisers instead of QSTR_INIT()]
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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;
+