From: Linus Torvalds Date: Wed, 9 Sep 2015 00:52:23 +0000 (-0700) Subject: Merge branch 'akpm' (patches from Andrew) X-Git-Tag: v4.3-rc1~40 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=f6f7a6369203fa3e07efb7f35cfd81efe9f25b07;p=linux.git Merge branch 'akpm' (patches from Andrew) Merge second patch-bomb from Andrew Morton: "Almost all of the rest of MM. There was an unusually large amount of MM material this time" * emailed patches from Andrew Morton : (141 commits) zpool: remove no-op module init/exit mm: zbud: constify the zbud_ops mm: zpool: constify the zpool_ops mm: swap: zswap: maybe_preload & refactoring zram: unify error reporting zsmalloc: remove null check from destroy_handle_cache() zsmalloc: do not take class lock in zs_shrinker_count() zsmalloc: use class->pages_per_zspage zsmalloc: consider ZS_ALMOST_FULL as migrate source zsmalloc: partial page ordering within a fullness_list zsmalloc: use shrinker to trigger auto-compaction zsmalloc: account the number of compacted pages zsmalloc/zram: introduce zs_pool_stats api zsmalloc: cosmetic compaction code adjustments zsmalloc: introduce zs_can_compact() function zsmalloc: always keep per-class stats zsmalloc: drop unused variable `nr_to_migrate' mm/memblock.c: fix comment in __next_mem_range() mm/page_alloc.c: fix type information of memoryless node memory-hotplug: fix comments in zone_spanned_pages_in_node() and zone_spanned_pages_in_node() ... --- f6f7a6369203fa3e07efb7f35cfd81efe9f25b07 diff --cc fs/dax.c index 57bb70b4af70,ed54efedade6..e43389c74bbc --- a/fs/dax.c +++ b/fs/dax.c @@@ -283,10 -272,9 +283,9 @@@ static int copy_user_bh(struct page *to static int dax_insert_mapping(struct inode *inode, struct buffer_head *bh, struct vm_area_struct *vma, struct vm_fault *vmf) { - struct address_space *mapping = inode->i_mapping; sector_t sector = bh->b_blocknr << (inode->i_blkbits - 9); unsigned long vaddr = (unsigned long)vmf->virtual_address; - void *addr; + void __pmem *addr; unsigned long pfn; pgoff_t size; int error; diff --cc include/linux/mm.h index 1171a292e06e,11df1a8ea38b..f25a957bf0ab --- a/include/linux/mm.h +++ b/include/linux/mm.h @@@ -359,27 -349,8 +349,15 @@@ static inline int get_page_unless_zero( return atomic_inc_not_zero(&page->_count); } - /* - * Try to drop a ref unless the page has a refcount of one, return false if - * that is the case. - * This is to make sure that the refcount won't become zero after this drop. - * This can be called when MMU is off so it must not access - * any of the virtual mappings. - */ - static inline int put_page_unless_one(struct page *page) - { - return atomic_add_unless(&page->_count, -1, 1); - } - extern int page_is_ram(unsigned long pfn); -extern int region_is_ram(resource_size_t phys_addr, unsigned long size); + +enum { + REGION_INTERSECTS, + REGION_DISJOINT, + REGION_MIXED, +}; + +int region_intersects(resource_size_t offset, size_t size, const char *type); /* Support for virtually mapped pages */ struct page *vmalloc_to_page(const void *addr); diff --cc mm/early_ioremap.c index 0cfadafb3fb0,a0baeb4be934..23f744d77ce0 --- a/mm/early_ioremap.c +++ b/mm/early_ioremap.c @@@ -217,13 -217,28 +217,35 @@@ early_memremap(resource_size_t phys_add return (__force void *)__early_ioremap(phys_addr, size, FIXMAP_PAGE_NORMAL); } +#ifdef FIXMAP_PAGE_RO +void __init * +early_memremap_ro(resource_size_t phys_addr, unsigned long size) +{ + return (__force void *)__early_ioremap(phys_addr, size, FIXMAP_PAGE_RO); +} +#endif + + #define MAX_MAP_CHUNK (NR_FIX_BTMAPS << PAGE_SHIFT) + + void __init copy_from_early_mem(void *dest, phys_addr_t src, unsigned long size) + { + unsigned long slop, clen; + char *p; + + while (size) { + slop = src & ~PAGE_MASK; + clen = size; + if (clen > MAX_MAP_CHUNK - slop) + clen = MAX_MAP_CHUNK - slop; + p = early_memremap(src & PAGE_MASK, clen + slop); + memcpy(dest, p + slop, clen); + early_memunmap(p, clen + slop); + dest += clen; + src += clen; + size -= clen; + } + } + #else /* CONFIG_MMU */ void __init __iomem *