Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 1 | #include <linux/debugfs.h> |
| 2 | #include <linux/mm.h> |
| 3 | #include <linux/slab.h> |
| 4 | #include <linux/uaccess.h> |
| 5 | #include <linux/bootmem.h> |
| 6 | #include <linux/stacktrace.h> |
| 7 | #include <linux/page_owner.h> |
Vlastimil Babka | 7dd80b8 | 2016-03-15 14:56:12 -0700 | [diff] [blame] | 8 | #include <linux/jump_label.h> |
Vlastimil Babka | 7cd12b4 | 2016-03-15 14:56:18 -0700 | [diff] [blame] | 9 | #include <linux/migrate.h> |
Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 10 | #include "internal.h" |
| 11 | |
| 12 | static bool page_owner_disabled = true; |
Vlastimil Babka | 7dd80b8 | 2016-03-15 14:56:12 -0700 | [diff] [blame] | 13 | DEFINE_STATIC_KEY_FALSE(page_owner_inited); |
Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 14 | |
Joonsoo Kim | 61cf5fe | 2014-12-12 16:56:04 -0800 | [diff] [blame] | 15 | static void init_early_allocated_pages(void); |
| 16 | |
Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 17 | static int early_page_owner_param(char *buf) |
| 18 | { |
| 19 | if (!buf) |
| 20 | return -EINVAL; |
| 21 | |
| 22 | if (strcmp(buf, "on") == 0) |
| 23 | page_owner_disabled = false; |
| 24 | |
| 25 | return 0; |
| 26 | } |
| 27 | early_param("page_owner", early_page_owner_param); |
| 28 | |
| 29 | static bool need_page_owner(void) |
| 30 | { |
| 31 | if (page_owner_disabled) |
| 32 | return false; |
| 33 | |
| 34 | return true; |
| 35 | } |
| 36 | |
| 37 | static void init_page_owner(void) |
| 38 | { |
| 39 | if (page_owner_disabled) |
| 40 | return; |
| 41 | |
Vlastimil Babka | 7dd80b8 | 2016-03-15 14:56:12 -0700 | [diff] [blame] | 42 | static_branch_enable(&page_owner_inited); |
Joonsoo Kim | 61cf5fe | 2014-12-12 16:56:04 -0800 | [diff] [blame] | 43 | init_early_allocated_pages(); |
Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 44 | } |
| 45 | |
| 46 | struct page_ext_operations page_owner_ops = { |
| 47 | .need = need_page_owner, |
| 48 | .init = init_page_owner, |
| 49 | }; |
| 50 | |
| 51 | void __reset_page_owner(struct page *page, unsigned int order) |
| 52 | { |
| 53 | int i; |
| 54 | struct page_ext *page_ext; |
| 55 | |
| 56 | for (i = 0; i < (1 << order); i++) { |
| 57 | page_ext = lookup_page_ext(page + i); |
Yang Shi | f86e427 | 2016-06-03 14:55:38 -0700 | [diff] [blame] | 58 | if (unlikely(!page_ext)) |
| 59 | continue; |
Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 60 | __clear_bit(PAGE_EXT_OWNER, &page_ext->flags); |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | void __set_page_owner(struct page *page, unsigned int order, gfp_t gfp_mask) |
| 65 | { |
Sergei Rogachev | 94f759d6 | 2015-02-11 15:28:34 -0800 | [diff] [blame] | 66 | struct page_ext *page_ext = lookup_page_ext(page); |
Yang Shi | f86e427 | 2016-06-03 14:55:38 -0700 | [diff] [blame] | 67 | |
Sergei Rogachev | 94f759d6 | 2015-02-11 15:28:34 -0800 | [diff] [blame] | 68 | struct stack_trace trace = { |
| 69 | .nr_entries = 0, |
| 70 | .max_entries = ARRAY_SIZE(page_ext->trace_entries), |
| 71 | .entries = &page_ext->trace_entries[0], |
| 72 | .skip = 3, |
| 73 | }; |
Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 74 | |
Yang Shi | f86e427 | 2016-06-03 14:55:38 -0700 | [diff] [blame] | 75 | if (unlikely(!page_ext)) |
| 76 | return; |
| 77 | |
Sergei Rogachev | 94f759d6 | 2015-02-11 15:28:34 -0800 | [diff] [blame] | 78 | save_stack_trace(&trace); |
Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 79 | |
| 80 | page_ext->order = order; |
| 81 | page_ext->gfp_mask = gfp_mask; |
Sergei Rogachev | 94f759d6 | 2015-02-11 15:28:34 -0800 | [diff] [blame] | 82 | page_ext->nr_entries = trace.nr_entries; |
Vlastimil Babka | 7cd12b4 | 2016-03-15 14:56:18 -0700 | [diff] [blame] | 83 | page_ext->last_migrate_reason = -1; |
Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 84 | |
| 85 | __set_bit(PAGE_EXT_OWNER, &page_ext->flags); |
| 86 | } |
| 87 | |
Vlastimil Babka | 7cd12b4 | 2016-03-15 14:56:18 -0700 | [diff] [blame] | 88 | void __set_page_owner_migrate_reason(struct page *page, int reason) |
| 89 | { |
| 90 | struct page_ext *page_ext = lookup_page_ext(page); |
Yang Shi | f86e427 | 2016-06-03 14:55:38 -0700 | [diff] [blame] | 91 | if (unlikely(!page_ext)) |
| 92 | return; |
Vlastimil Babka | 7cd12b4 | 2016-03-15 14:56:18 -0700 | [diff] [blame] | 93 | |
| 94 | page_ext->last_migrate_reason = reason; |
| 95 | } |
| 96 | |
Joonsoo Kim | e2cfc91 | 2015-07-17 16:24:18 -0700 | [diff] [blame] | 97 | gfp_t __get_page_owner_gfp(struct page *page) |
| 98 | { |
| 99 | struct page_ext *page_ext = lookup_page_ext(page); |
Yang Shi | f86e427 | 2016-06-03 14:55:38 -0700 | [diff] [blame] | 100 | if (unlikely(!page_ext)) |
| 101 | /* |
| 102 | * The caller just returns 0 if no valid gfp |
| 103 | * So return 0 here too. |
| 104 | */ |
| 105 | return 0; |
Joonsoo Kim | e2cfc91 | 2015-07-17 16:24:18 -0700 | [diff] [blame] | 106 | |
| 107 | return page_ext->gfp_mask; |
| 108 | } |
| 109 | |
Vlastimil Babka | d435edc | 2016-03-15 14:56:15 -0700 | [diff] [blame] | 110 | void __copy_page_owner(struct page *oldpage, struct page *newpage) |
| 111 | { |
| 112 | struct page_ext *old_ext = lookup_page_ext(oldpage); |
| 113 | struct page_ext *new_ext = lookup_page_ext(newpage); |
| 114 | int i; |
| 115 | |
Yang Shi | f86e427 | 2016-06-03 14:55:38 -0700 | [diff] [blame] | 116 | if (unlikely(!old_ext || !new_ext)) |
| 117 | return; |
| 118 | |
Vlastimil Babka | d435edc | 2016-03-15 14:56:15 -0700 | [diff] [blame] | 119 | new_ext->order = old_ext->order; |
| 120 | new_ext->gfp_mask = old_ext->gfp_mask; |
Joonsoo Kim | a8efe1c | 2016-07-26 15:23:46 -0700 | [diff] [blame^] | 121 | new_ext->last_migrate_reason = old_ext->last_migrate_reason; |
Vlastimil Babka | d435edc | 2016-03-15 14:56:15 -0700 | [diff] [blame] | 122 | new_ext->nr_entries = old_ext->nr_entries; |
| 123 | |
| 124 | for (i = 0; i < ARRAY_SIZE(new_ext->trace_entries); i++) |
| 125 | new_ext->trace_entries[i] = old_ext->trace_entries[i]; |
| 126 | |
| 127 | /* |
| 128 | * We don't clear the bit on the oldpage as it's going to be freed |
| 129 | * after migration. Until then, the info can be useful in case of |
| 130 | * a bug, and the overal stats will be off a bit only temporarily. |
| 131 | * Also, migrate_misplaced_transhuge_page() can still fail the |
| 132 | * migration and then we want the oldpage to retain the info. But |
| 133 | * in that case we also don't need to explicitly clear the info from |
| 134 | * the new page, which will be freed. |
| 135 | */ |
| 136 | __set_bit(PAGE_EXT_OWNER, &new_ext->flags); |
| 137 | } |
| 138 | |
Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 139 | static ssize_t |
| 140 | print_page_owner(char __user *buf, size_t count, unsigned long pfn, |
| 141 | struct page *page, struct page_ext *page_ext) |
| 142 | { |
| 143 | int ret; |
| 144 | int pageblock_mt, page_mt; |
| 145 | char *kbuf; |
Sergei Rogachev | 94f759d6 | 2015-02-11 15:28:34 -0800 | [diff] [blame] | 146 | struct stack_trace trace = { |
| 147 | .nr_entries = page_ext->nr_entries, |
| 148 | .entries = &page_ext->trace_entries[0], |
| 149 | }; |
Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 150 | |
| 151 | kbuf = kmalloc(count, GFP_KERNEL); |
| 152 | if (!kbuf) |
| 153 | return -ENOMEM; |
| 154 | |
| 155 | ret = snprintf(kbuf, count, |
Vlastimil Babka | 60f3035 | 2016-03-15 14:56:08 -0700 | [diff] [blame] | 156 | "Page allocated via order %u, mask %#x(%pGg)\n", |
| 157 | page_ext->order, page_ext->gfp_mask, |
| 158 | &page_ext->gfp_mask); |
Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 159 | |
| 160 | if (ret >= count) |
| 161 | goto err; |
| 162 | |
| 163 | /* Print information relevant to grouping pages by mobility */ |
Mel Gorman | 0b423ca | 2016-05-19 17:14:27 -0700 | [diff] [blame] | 164 | pageblock_mt = get_pageblock_migratetype(page); |
Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 165 | page_mt = gfpflags_to_migratetype(page_ext->gfp_mask); |
| 166 | ret += snprintf(kbuf + ret, count - ret, |
Vlastimil Babka | 60f3035 | 2016-03-15 14:56:08 -0700 | [diff] [blame] | 167 | "PFN %lu type %s Block %lu type %s Flags %#lx(%pGp)\n", |
Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 168 | pfn, |
Vlastimil Babka | 60f3035 | 2016-03-15 14:56:08 -0700 | [diff] [blame] | 169 | migratetype_names[page_mt], |
Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 170 | pfn >> pageblock_order, |
Vlastimil Babka | 60f3035 | 2016-03-15 14:56:08 -0700 | [diff] [blame] | 171 | migratetype_names[pageblock_mt], |
| 172 | page->flags, &page->flags); |
Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 173 | |
| 174 | if (ret >= count) |
| 175 | goto err; |
| 176 | |
Sergei Rogachev | 94f759d6 | 2015-02-11 15:28:34 -0800 | [diff] [blame] | 177 | ret += snprint_stack_trace(kbuf + ret, count - ret, &trace, 0); |
Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 178 | if (ret >= count) |
| 179 | goto err; |
| 180 | |
Vlastimil Babka | 7cd12b4 | 2016-03-15 14:56:18 -0700 | [diff] [blame] | 181 | if (page_ext->last_migrate_reason != -1) { |
| 182 | ret += snprintf(kbuf + ret, count - ret, |
| 183 | "Page has been migrated, last migrate reason: %s\n", |
| 184 | migrate_reason_names[page_ext->last_migrate_reason]); |
| 185 | if (ret >= count) |
| 186 | goto err; |
| 187 | } |
| 188 | |
Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 189 | ret += snprintf(kbuf + ret, count - ret, "\n"); |
| 190 | if (ret >= count) |
| 191 | goto err; |
| 192 | |
| 193 | if (copy_to_user(buf, kbuf, ret)) |
| 194 | ret = -EFAULT; |
| 195 | |
| 196 | kfree(kbuf); |
| 197 | return ret; |
| 198 | |
| 199 | err: |
| 200 | kfree(kbuf); |
| 201 | return -ENOMEM; |
| 202 | } |
| 203 | |
Vlastimil Babka | 4e46211 | 2016-03-15 14:56:21 -0700 | [diff] [blame] | 204 | void __dump_page_owner(struct page *page) |
| 205 | { |
| 206 | struct page_ext *page_ext = lookup_page_ext(page); |
| 207 | struct stack_trace trace = { |
| 208 | .nr_entries = page_ext->nr_entries, |
| 209 | .entries = &page_ext->trace_entries[0], |
| 210 | }; |
Sudip Mukherjee | 8285027 | 2016-06-24 14:50:24 -0700 | [diff] [blame] | 211 | gfp_t gfp_mask; |
| 212 | int mt; |
Vlastimil Babka | 4e46211 | 2016-03-15 14:56:21 -0700 | [diff] [blame] | 213 | |
Yang Shi | f86e427 | 2016-06-03 14:55:38 -0700 | [diff] [blame] | 214 | if (unlikely(!page_ext)) { |
| 215 | pr_alert("There is not page extension available.\n"); |
| 216 | return; |
| 217 | } |
Sudip Mukherjee | 8285027 | 2016-06-24 14:50:24 -0700 | [diff] [blame] | 218 | gfp_mask = page_ext->gfp_mask; |
| 219 | mt = gfpflags_to_migratetype(gfp_mask); |
Yang Shi | f86e427 | 2016-06-03 14:55:38 -0700 | [diff] [blame] | 220 | |
Vlastimil Babka | 4e46211 | 2016-03-15 14:56:21 -0700 | [diff] [blame] | 221 | if (!test_bit(PAGE_EXT_OWNER, &page_ext->flags)) { |
| 222 | pr_alert("page_owner info is not active (free page?)\n"); |
| 223 | return; |
| 224 | } |
| 225 | |
Joe Perches | 756a025 | 2016-03-17 14:19:47 -0700 | [diff] [blame] | 226 | pr_alert("page allocated via order %u, migratetype %s, gfp_mask %#x(%pGg)\n", |
| 227 | page_ext->order, migratetype_names[mt], gfp_mask, &gfp_mask); |
Vlastimil Babka | 4e46211 | 2016-03-15 14:56:21 -0700 | [diff] [blame] | 228 | print_stack_trace(&trace, 0); |
| 229 | |
| 230 | if (page_ext->last_migrate_reason != -1) |
| 231 | pr_alert("page has been migrated, last migrate reason: %s\n", |
| 232 | migrate_reason_names[page_ext->last_migrate_reason]); |
| 233 | } |
| 234 | |
Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 235 | static ssize_t |
| 236 | read_page_owner(struct file *file, char __user *buf, size_t count, loff_t *ppos) |
| 237 | { |
| 238 | unsigned long pfn; |
| 239 | struct page *page; |
| 240 | struct page_ext *page_ext; |
| 241 | |
Vlastimil Babka | 7dd80b8 | 2016-03-15 14:56:12 -0700 | [diff] [blame] | 242 | if (!static_branch_unlikely(&page_owner_inited)) |
Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 243 | return -EINVAL; |
| 244 | |
| 245 | page = NULL; |
| 246 | pfn = min_low_pfn + *ppos; |
| 247 | |
| 248 | /* Find a valid PFN or the start of a MAX_ORDER_NR_PAGES area */ |
| 249 | while (!pfn_valid(pfn) && (pfn & (MAX_ORDER_NR_PAGES - 1)) != 0) |
| 250 | pfn++; |
| 251 | |
| 252 | drain_all_pages(NULL); |
| 253 | |
| 254 | /* Find an allocated page */ |
| 255 | for (; pfn < max_pfn; pfn++) { |
| 256 | /* |
| 257 | * If the new page is in a new MAX_ORDER_NR_PAGES area, |
| 258 | * validate the area as existing, skip it if not |
| 259 | */ |
| 260 | if ((pfn & (MAX_ORDER_NR_PAGES - 1)) == 0 && !pfn_valid(pfn)) { |
| 261 | pfn += MAX_ORDER_NR_PAGES - 1; |
| 262 | continue; |
| 263 | } |
| 264 | |
| 265 | /* Check for holes within a MAX_ORDER area */ |
| 266 | if (!pfn_valid_within(pfn)) |
| 267 | continue; |
| 268 | |
| 269 | page = pfn_to_page(pfn); |
| 270 | if (PageBuddy(page)) { |
| 271 | unsigned long freepage_order = page_order_unsafe(page); |
| 272 | |
| 273 | if (freepage_order < MAX_ORDER) |
| 274 | pfn += (1UL << freepage_order) - 1; |
| 275 | continue; |
| 276 | } |
| 277 | |
| 278 | page_ext = lookup_page_ext(page); |
Yang Shi | f86e427 | 2016-06-03 14:55:38 -0700 | [diff] [blame] | 279 | if (unlikely(!page_ext)) |
| 280 | continue; |
Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 281 | |
| 282 | /* |
Joonsoo Kim | 61cf5fe | 2014-12-12 16:56:04 -0800 | [diff] [blame] | 283 | * Some pages could be missed by concurrent allocation or free, |
| 284 | * because we don't hold the zone lock. |
Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 285 | */ |
| 286 | if (!test_bit(PAGE_EXT_OWNER, &page_ext->flags)) |
| 287 | continue; |
| 288 | |
| 289 | /* Record the next PFN to read in the file offset */ |
| 290 | *ppos = (pfn - min_low_pfn) + 1; |
| 291 | |
| 292 | return print_page_owner(buf, count, pfn, page, page_ext); |
| 293 | } |
| 294 | |
| 295 | return 0; |
| 296 | } |
| 297 | |
Joonsoo Kim | 61cf5fe | 2014-12-12 16:56:04 -0800 | [diff] [blame] | 298 | static void init_pages_in_zone(pg_data_t *pgdat, struct zone *zone) |
| 299 | { |
| 300 | struct page *page; |
| 301 | struct page_ext *page_ext; |
| 302 | unsigned long pfn = zone->zone_start_pfn, block_end_pfn; |
| 303 | unsigned long end_pfn = pfn + zone->spanned_pages; |
| 304 | unsigned long count = 0; |
| 305 | |
| 306 | /* Scan block by block. First and last block may be incomplete */ |
| 307 | pfn = zone->zone_start_pfn; |
| 308 | |
| 309 | /* |
| 310 | * Walk the zone in pageblock_nr_pages steps. If a page block spans |
| 311 | * a zone boundary, it will be double counted between zones. This does |
| 312 | * not matter as the mixed block count will still be correct |
| 313 | */ |
| 314 | for (; pfn < end_pfn; ) { |
| 315 | if (!pfn_valid(pfn)) { |
| 316 | pfn = ALIGN(pfn + 1, MAX_ORDER_NR_PAGES); |
| 317 | continue; |
| 318 | } |
| 319 | |
| 320 | block_end_pfn = ALIGN(pfn + 1, pageblock_nr_pages); |
| 321 | block_end_pfn = min(block_end_pfn, end_pfn); |
| 322 | |
| 323 | page = pfn_to_page(pfn); |
| 324 | |
| 325 | for (; pfn < block_end_pfn; pfn++) { |
| 326 | if (!pfn_valid_within(pfn)) |
| 327 | continue; |
| 328 | |
| 329 | page = pfn_to_page(pfn); |
| 330 | |
Joonsoo Kim | 9d43f5a | 2016-05-19 17:12:13 -0700 | [diff] [blame] | 331 | if (page_zone(page) != zone) |
| 332 | continue; |
| 333 | |
Joonsoo Kim | 61cf5fe | 2014-12-12 16:56:04 -0800 | [diff] [blame] | 334 | /* |
| 335 | * We are safe to check buddy flag and order, because |
| 336 | * this is init stage and only single thread runs. |
| 337 | */ |
| 338 | if (PageBuddy(page)) { |
| 339 | pfn += (1UL << page_order(page)) - 1; |
| 340 | continue; |
| 341 | } |
| 342 | |
| 343 | if (PageReserved(page)) |
| 344 | continue; |
| 345 | |
| 346 | page_ext = lookup_page_ext(page); |
Yang Shi | f86e427 | 2016-06-03 14:55:38 -0700 | [diff] [blame] | 347 | if (unlikely(!page_ext)) |
| 348 | continue; |
Joonsoo Kim | 61cf5fe | 2014-12-12 16:56:04 -0800 | [diff] [blame] | 349 | |
| 350 | /* Maybe overraping zone */ |
| 351 | if (test_bit(PAGE_EXT_OWNER, &page_ext->flags)) |
| 352 | continue; |
| 353 | |
| 354 | /* Found early allocated page */ |
| 355 | set_page_owner(page, 0, 0); |
| 356 | count++; |
| 357 | } |
| 358 | } |
| 359 | |
| 360 | pr_info("Node %d, zone %8s: page owner found early allocated %lu pages\n", |
| 361 | pgdat->node_id, zone->name, count); |
| 362 | } |
| 363 | |
| 364 | static void init_zones_in_node(pg_data_t *pgdat) |
| 365 | { |
| 366 | struct zone *zone; |
| 367 | struct zone *node_zones = pgdat->node_zones; |
| 368 | unsigned long flags; |
| 369 | |
| 370 | for (zone = node_zones; zone - node_zones < MAX_NR_ZONES; ++zone) { |
| 371 | if (!populated_zone(zone)) |
| 372 | continue; |
| 373 | |
| 374 | spin_lock_irqsave(&zone->lock, flags); |
| 375 | init_pages_in_zone(pgdat, zone); |
| 376 | spin_unlock_irqrestore(&zone->lock, flags); |
| 377 | } |
| 378 | } |
| 379 | |
| 380 | static void init_early_allocated_pages(void) |
| 381 | { |
| 382 | pg_data_t *pgdat; |
| 383 | |
| 384 | drain_all_pages(NULL); |
| 385 | for_each_online_pgdat(pgdat) |
| 386 | init_zones_in_node(pgdat); |
| 387 | } |
| 388 | |
Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 389 | static const struct file_operations proc_page_owner_operations = { |
| 390 | .read = read_page_owner, |
| 391 | }; |
| 392 | |
| 393 | static int __init pageowner_init(void) |
| 394 | { |
| 395 | struct dentry *dentry; |
| 396 | |
Vlastimil Babka | 7dd80b8 | 2016-03-15 14:56:12 -0700 | [diff] [blame] | 397 | if (!static_branch_unlikely(&page_owner_inited)) { |
Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 398 | pr_info("page_owner is disabled\n"); |
| 399 | return 0; |
| 400 | } |
| 401 | |
| 402 | dentry = debugfs_create_file("page_owner", S_IRUSR, NULL, |
| 403 | NULL, &proc_page_owner_operations); |
| 404 | if (IS_ERR(dentry)) |
| 405 | return PTR_ERR(dentry); |
| 406 | |
| 407 | return 0; |
| 408 | } |
Paul Gortmaker | 44c5af9 | 2015-05-01 21:57:34 -0400 | [diff] [blame] | 409 | late_initcall(pageowner_init) |