Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'akpm' (patches from Andrew)

Merge fixes from Andrew Morton:
"14 fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
rapidio/tsi721: fix incorrect detection of address translation condition
rapidio/documentation/mport_cdev: add missing parameter description
kernel/fork: fix CLONE_CHILD_CLEARTID regression in nscd
MAINTAINERS: Vladimir has moved
mm, mempolicy: task->mempolicy must be NULL before dropping final reference
printk/nmi: avoid direct printk()-s from __printk_nmi_flush()
treewide: remove references to the now unnecessary DEFINE_PCI_DEVICE_TABLE
drivers/scsi/wd719x.c: remove last declaration using DEFINE_PCI_DEVICE_TABLE
mm, vmscan: only allocate and reclaim from zones with pages managed by the buddy allocator
lib/test_hash.c: fix warning in preprocessor symbol evaluation
lib/test_hash.c: fix warning in two-dimensional array init
kconfig: tinyconfig: provide whole choice blocks to avoid warnings
kexec: fix double-free when failing to relocate the purgatory
mm, oom: prevent premature OOM killer invocation for high order request

+116 -124
+2
.mailmap
··· 158 158 Viresh Kumar <vireshk@kernel.org> <viresh.kumar@st.com> 159 159 Viresh Kumar <vireshk@kernel.org> <viresh.linux@gmail.com> 160 160 Viresh Kumar <vireshk@kernel.org> <viresh.kumar2@arm.com> 161 + Vladimir Davydov <vdavydov.dev@gmail.com> <vdavydov@virtuozzo.com> 162 + Vladimir Davydov <vdavydov.dev@gmail.com> <vdavydov@parallels.com> 161 163 Takashi YOSHII <takashi.yoshii.zj@renesas.com> 162 164 Yusuke Goda <goda.yusuke@renesas.com> 163 165 Gustavo Padovan <gustavo@las.ic.unicamp.br>
-1
Documentation/PCI/pci.txt
··· 124 124 125 125 The ID table is an array of struct pci_device_id entries ending with an 126 126 all-zero entry. Definitions with static const are generally preferred. 127 - Use of the deprecated macro DEFINE_PCI_DEVICE_TABLE should be avoided. 128 127 129 128 Each entry consists of: 130 129
+4
Documentation/rapidio/mport_cdev.txt
··· 80 80 81 81 III. Module parameters 82 82 83 + - 'dma_timeout' - DMA transfer completion timeout (in msec, default value 3000). 84 + This parameter set a maximum completion wait time for SYNC mode DMA 85 + transfer requests and for RIO_WAIT_FOR_ASYNC ioctl requests. 86 + 83 87 - 'dbg_level' - This parameter allows to control amount of debug information 84 88 generated by this device driver. This parameter is formed by set of 85 89 bit masks that correspond to the specific functional blocks.
+1 -1
MAINTAINERS
··· 3247 3247 CONTROL GROUP - MEMORY RESOURCE CONTROLLER (MEMCG) 3248 3248 M: Johannes Weiner <hannes@cmpxchg.org> 3249 3249 M: Michal Hocko <mhocko@kernel.org> 3250 - M: Vladimir Davydov <vdavydov@virtuozzo.com> 3250 + M: Vladimir Davydov <vdavydov.dev@gmail.com> 3251 3251 L: cgroups@vger.kernel.org 3252 3252 L: linux-mm@kvack.org 3253 3253 S: Maintained
+2
arch/x86/configs/tiny.config
··· 1 1 CONFIG_NOHIGHMEM=y 2 + # CONFIG_HIGHMEM4G is not set 3 + # CONFIG_HIGHMEM64G is not set
+1 -1
drivers/rapidio/devices/tsi721.c
··· 1161 1161 } else if (ibw_start < (ib_win->rstart + ib_win->size) && 1162 1162 (ibw_start + ibw_size) > ib_win->rstart) { 1163 1163 /* Return error if address translation involved */ 1164 - if (direct && ib_win->xlat) { 1164 + if (!direct || ib_win->xlat) { 1165 1165 ret = -EFAULT; 1166 1166 break; 1167 1167 }
+1 -1
drivers/scsi/wd719x.c
··· 962 962 scsi_host_put(sh); 963 963 } 964 964 965 - static DEFINE_PCI_DEVICE_TABLE(wd719x_pci_table) = { 965 + static const struct pci_device_id wd719x_pci_table[] = { 966 966 { PCI_DEVICE(PCI_VENDOR_ID_WD, 0x3296) }, 967 967 {} 968 968 };
+4
include/linux/mempolicy.h
··· 195 195 } 196 196 197 197 extern int mpol_misplaced(struct page *, struct vm_area_struct *, unsigned long); 198 + extern void mpol_put_task_policy(struct task_struct *); 198 199 199 200 #else 200 201 ··· 298 297 return -1; /* no node preference */ 299 298 } 300 299 300 + static inline void mpol_put_task_policy(struct task_struct *task) 301 + { 302 + } 301 303 #endif /* CONFIG_NUMA */ 302 304 #endif
+14 -2
include/linux/mmzone.h
··· 828 828 */ 829 829 #define zone_idx(zone) ((zone) - (zone)->zone_pgdat->node_zones) 830 830 831 - static inline int populated_zone(struct zone *zone) 831 + /* 832 + * Returns true if a zone has pages managed by the buddy allocator. 833 + * All the reclaim decisions have to use this function rather than 834 + * populated_zone(). If the whole zone is reserved then we can easily 835 + * end up with populated_zone() && !managed_zone(). 836 + */ 837 + static inline bool managed_zone(struct zone *zone) 832 838 { 833 - return (!!zone->present_pages); 839 + return zone->managed_pages; 840 + } 841 + 842 + /* Returns true if a zone has memory */ 843 + static inline bool populated_zone(struct zone *zone) 844 + { 845 + return zone->present_pages; 834 846 } 835 847 836 848 extern int movable_zone;
-9
include/linux/pci.h
··· 683 683 #define to_pci_driver(drv) container_of(drv, struct pci_driver, driver) 684 684 685 685 /** 686 - * DEFINE_PCI_DEVICE_TABLE - macro used to describe a pci device table 687 - * @_table: device table name 688 - * 689 - * This macro is deprecated and should not be used in new code. 690 - */ 691 - #define DEFINE_PCI_DEVICE_TABLE(_table) \ 692 - const struct pci_device_id _table[] 693 - 694 - /** 695 686 * PCI_DEVICE - macro used to describe a specific pci device 696 687 * @vend: the 16 bit PCI Vendor ID 697 688 * @dev: the 16 bit PCI Device ID
+8
kernel/configs/tiny.config
··· 1 + # CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set 1 2 CONFIG_CC_OPTIMIZE_FOR_SIZE=y 3 + # CONFIG_KERNEL_GZIP is not set 4 + # CONFIG_KERNEL_BZIP2 is not set 5 + # CONFIG_KERNEL_LZMA is not set 2 6 CONFIG_KERNEL_XZ=y 7 + # CONFIG_KERNEL_LZO is not set 8 + # CONFIG_KERNEL_LZ4 is not set 3 9 CONFIG_OPTIMIZE_INLINING=y 10 + # CONFIG_SLAB is not set 11 + # CONFIG_SLUB is not set 4 12 CONFIG_SLOB=y
+1 -6
kernel/exit.c
··· 848 848 TASKS_RCU(preempt_enable()); 849 849 exit_notify(tsk, group_dead); 850 850 proc_exit_connector(tsk); 851 - #ifdef CONFIG_NUMA 852 - task_lock(tsk); 853 - mpol_put(tsk->mempolicy); 854 - tsk->mempolicy = NULL; 855 - task_unlock(tsk); 856 - #endif 851 + mpol_put_task_policy(tsk); 857 852 #ifdef CONFIG_FUTEX 858 853 if (unlikely(current->pi_state_cache)) 859 854 kfree(current->pi_state_cache);
+4 -6
kernel/fork.c
··· 936 936 deactivate_mm(tsk, mm); 937 937 938 938 /* 939 - * If we're exiting normally, clear a user-space tid field if 940 - * requested. We leave this alone when dying by signal, to leave 941 - * the value intact in a core dump, and to save the unnecessary 942 - * trouble, say, a killed vfork parent shouldn't touch this mm. 943 - * Userland only wants this done for a sys_exit. 939 + * Signal userspace if we're not exiting with a core dump 940 + * because we want to leave the value intact for debugging 941 + * purposes. 944 942 */ 945 943 if (tsk->clear_child_tid) { 946 - if (!(tsk->flags & PF_SIGNALED) && 944 + if (!(tsk->signal->flags & SIGNAL_GROUP_COREDUMP) && 947 945 atomic_read(&mm->mm_users) > 1) { 948 946 /* 949 947 * We don't check the error code - if userspace has
+3
kernel/kexec_file.c
··· 887 887 return 0; 888 888 out: 889 889 vfree(pi->sechdrs); 890 + pi->sechdrs = NULL; 891 + 890 892 vfree(pi->purgatory_buf); 893 + pi->purgatory_buf = NULL; 891 894 return ret; 892 895 } 893 896
+23 -15
kernel/printk/nmi.c
··· 99 99 return add; 100 100 } 101 101 102 - /* 103 - * printk one line from the temporary buffer from @start index until 104 - * and including the @end index. 105 - */ 106 - static void print_nmi_seq_line(struct nmi_seq_buf *s, int start, int end) 102 + static void printk_nmi_flush_line(const char *text, int len) 107 103 { 108 - const char *buf = s->buffer + start; 109 - 110 104 /* 111 105 * The buffers are flushed in NMI only on panic. The messages must 112 106 * go only into the ring buffer at this stage. Consoles will get 113 107 * explicitly called later when a crashdump is not generated. 114 108 */ 115 109 if (in_nmi()) 116 - printk_deferred("%.*s", (end - start) + 1, buf); 110 + printk_deferred("%.*s", len, text); 117 111 else 118 - printk("%.*s", (end - start) + 1, buf); 112 + printk("%.*s", len, text); 119 113 114 + } 115 + 116 + /* 117 + * printk one line from the temporary buffer from @start index until 118 + * and including the @end index. 119 + */ 120 + static void printk_nmi_flush_seq_line(struct nmi_seq_buf *s, 121 + int start, int end) 122 + { 123 + const char *buf = s->buffer + start; 124 + 125 + printk_nmi_flush_line(buf, (end - start) + 1); 120 126 } 121 127 122 128 /* ··· 156 150 * the buffer an unexpected way. If we printed something then 157 151 * @len must only increase. 158 152 */ 159 - if (i && i >= len) 160 - pr_err("printk_nmi_flush: internal error: i=%d >= len=%zu\n", 161 - i, len); 153 + if (i && i >= len) { 154 + const char *msg = "printk_nmi_flush: internal error\n"; 155 + 156 + printk_nmi_flush_line(msg, strlen(msg)); 157 + } 162 158 163 159 if (!len) 164 160 goto out; /* Someone else has already flushed the buffer. */ ··· 174 166 /* Print line by line. */ 175 167 for (; i < size; i++) { 176 168 if (s->buffer[i] == '\n') { 177 - print_nmi_seq_line(s, last_i, i); 169 + printk_nmi_flush_seq_line(s, last_i, i); 178 170 last_i = i + 1; 179 171 } 180 172 } 181 173 /* Check if there was a partial line. */ 182 174 if (last_i < size) { 183 - print_nmi_seq_line(s, last_i, size - 1); 184 - pr_cont("\n"); 175 + printk_nmi_flush_seq_line(s, last_i, size - 1); 176 + printk_nmi_flush_line("\n", strlen("\n")); 185 177 } 186 178 187 179 /*
+16 -10
lib/test_hash.c
··· 143 143 test_hash_init(void) 144 144 { 145 145 char buf[SIZE+1]; 146 - u32 string_or = 0, hash_or[2][33] = { 0 }; 146 + u32 string_or = 0, hash_or[2][33] = { { 0, } }; 147 147 unsigned tests = 0; 148 148 unsigned long long h64 = 0; 149 149 int i, j; ··· 219 219 } 220 220 221 221 /* Issue notices about skipped tests. */ 222 - #ifndef HAVE_ARCH__HASH_32 223 - pr_info("__hash_32() has no arch implementation to test."); 224 - #elif HAVE_ARCH__HASH_32 != 1 222 + #ifdef HAVE_ARCH__HASH_32 223 + #if HAVE_ARCH__HASH_32 != 1 225 224 pr_info("__hash_32() is arch-specific; not compared to generic."); 226 225 #endif 227 - #ifndef HAVE_ARCH_HASH_32 228 - pr_info("hash_32() has no arch implementation to test."); 229 - #elif HAVE_ARCH_HASH_32 != 1 226 + #else 227 + pr_info("__hash_32() has no arch implementation to test."); 228 + #endif 229 + #ifdef HAVE_ARCH_HASH_32 230 + #if HAVE_ARCH_HASH_32 != 1 230 231 pr_info("hash_32() is arch-specific; not compared to generic."); 231 232 #endif 232 - #ifndef HAVE_ARCH_HASH_64 233 - pr_info("hash_64() has no arch implementation to test."); 234 - #elif HAVE_ARCH_HASH_64 != 1 233 + #else 234 + pr_info("hash_32() has no arch implementation to test."); 235 + #endif 236 + #ifdef HAVE_ARCH_HASH_64 237 + #if HAVE_ARCH_HASH_64 != 1 235 238 pr_info("hash_64() is arch-specific; not compared to generic."); 239 + #endif 240 + #else 241 + pr_info("hash_64() has no arch implementation to test."); 236 242 #endif 237 243 238 244 pr_notice("%u tests passed.", tests);
+17
mm/mempolicy.c
··· 2336 2336 return ret; 2337 2337 } 2338 2338 2339 + /* 2340 + * Drop the (possibly final) reference to task->mempolicy. It needs to be 2341 + * dropped after task->mempolicy is set to NULL so that any allocation done as 2342 + * part of its kmem_cache_free(), such as by KASAN, doesn't reference a freed 2343 + * policy. 2344 + */ 2345 + void mpol_put_task_policy(struct task_struct *task) 2346 + { 2347 + struct mempolicy *pol; 2348 + 2349 + task_lock(task); 2350 + pol = task->mempolicy; 2351 + task->mempolicy = NULL; 2352 + task_unlock(task); 2353 + mpol_put(pol); 2354 + } 2355 + 2339 2356 static void sp_delete(struct shared_policy *sp, struct sp_node *n) 2340 2357 { 2341 2358 pr_debug("deleting %lx-l%lx\n", n->start, n->end);
+4 -51
mm/page_alloc.c
··· 3137 3137 return NULL; 3138 3138 } 3139 3139 3140 - static inline bool 3141 - should_compact_retry(struct alloc_context *ac, int order, int alloc_flags, 3142 - enum compact_result compact_result, 3143 - enum compact_priority *compact_priority, 3144 - int compaction_retries) 3145 - { 3146 - int max_retries = MAX_COMPACT_RETRIES; 3147 - 3148 - if (!order) 3149 - return false; 3150 - 3151 - /* 3152 - * compaction considers all the zone as desperately out of memory 3153 - * so it doesn't really make much sense to retry except when the 3154 - * failure could be caused by insufficient priority 3155 - */ 3156 - if (compaction_failed(compact_result)) { 3157 - if (*compact_priority > MIN_COMPACT_PRIORITY) { 3158 - (*compact_priority)--; 3159 - return true; 3160 - } 3161 - return false; 3162 - } 3163 - 3164 - /* 3165 - * make sure the compaction wasn't deferred or didn't bail out early 3166 - * due to locks contention before we declare that we should give up. 3167 - * But do not retry if the given zonelist is not suitable for 3168 - * compaction. 3169 - */ 3170 - if (compaction_withdrawn(compact_result)) 3171 - return compaction_zonelist_suitable(ac, order, alloc_flags); 3172 - 3173 - /* 3174 - * !costly requests are much more important than __GFP_REPEAT 3175 - * costly ones because they are de facto nofail and invoke OOM 3176 - * killer to move on while costly can fail and users are ready 3177 - * to cope with that. 1/4 retries is rather arbitrary but we 3178 - * would need much more detailed feedback from compaction to 3179 - * make a better decision. 3180 - */ 3181 - if (order > PAGE_ALLOC_COSTLY_ORDER) 3182 - max_retries /= 4; 3183 - if (compaction_retries <= max_retries) 3184 - return true; 3185 - 3186 - return false; 3187 - } 3188 3140 #else 3189 3141 static inline struct page * 3190 3142 __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order, ··· 3146 3194 *compact_result = COMPACT_SKIPPED; 3147 3195 return NULL; 3148 3196 } 3197 + 3198 + #endif /* CONFIG_COMPACTION */ 3149 3199 3150 3200 static inline bool 3151 3201 should_compact_retry(struct alloc_context *ac, unsigned int order, int alloc_flags, ··· 3175 3221 } 3176 3222 return false; 3177 3223 } 3178 - #endif /* CONFIG_COMPACTION */ 3179 3224 3180 3225 /* Perform direct synchronous page reclaim */ 3181 3226 static int ··· 4360 4407 do { 4361 4408 zone_type--; 4362 4409 zone = pgdat->node_zones + zone_type; 4363 - if (populated_zone(zone)) { 4410 + if (managed_zone(zone)) { 4364 4411 zoneref_set_zone(zone, 4365 4412 &zonelist->_zonerefs[nr_zones++]); 4366 4413 check_highest_zone(zone_type); ··· 4598 4645 for (j = 0; j < nr_nodes; j++) { 4599 4646 node = node_order[j]; 4600 4647 z = &NODE_DATA(node)->node_zones[zone_type]; 4601 - if (populated_zone(z)) { 4648 + if (managed_zone(z)) { 4602 4649 zoneref_set_zone(z, 4603 4650 &zonelist->_zonerefs[pos++]); 4604 4651 check_highest_zone(zone_type);
+11 -11
mm/vmscan.c
··· 1665 1665 1666 1666 for (zid = sc->reclaim_idx; zid >= 0; zid--) { 1667 1667 zone = &pgdat->node_zones[zid]; 1668 - if (!populated_zone(zone)) 1668 + if (!managed_zone(zone)) 1669 1669 continue; 1670 1670 1671 1671 if (zone_page_state_snapshot(zone, NR_ZONE_LRU_BASE + ··· 2036 2036 struct zone *zone = &pgdat->node_zones[zid]; 2037 2037 unsigned long inactive_zone, active_zone; 2038 2038 2039 - if (!populated_zone(zone)) 2039 + if (!managed_zone(zone)) 2040 2040 continue; 2041 2041 2042 2042 inactive_zone = zone_page_state(zone, ··· 2171 2171 2172 2172 for (z = 0; z < MAX_NR_ZONES; z++) { 2173 2173 struct zone *zone = &pgdat->node_zones[z]; 2174 - if (!populated_zone(zone)) 2174 + if (!managed_zone(zone)) 2175 2175 continue; 2176 2176 2177 2177 total_high_wmark += high_wmark_pages(zone); ··· 2510 2510 /* If compaction would go ahead or the allocation would succeed, stop */ 2511 2511 for (z = 0; z <= sc->reclaim_idx; z++) { 2512 2512 struct zone *zone = &pgdat->node_zones[z]; 2513 - if (!populated_zone(zone)) 2513 + if (!managed_zone(zone)) 2514 2514 continue; 2515 2515 2516 2516 switch (compaction_suitable(zone, sc->order, 0, sc->reclaim_idx)) { ··· 2840 2840 2841 2841 for (i = 0; i <= ZONE_NORMAL; i++) { 2842 2842 zone = &pgdat->node_zones[i]; 2843 - if (!populated_zone(zone) || 2843 + if (!managed_zone(zone) || 2844 2844 pgdat_reclaimable_pages(pgdat) == 0) 2845 2845 continue; 2846 2846 ··· 3141 3141 for (i = 0; i <= classzone_idx; i++) { 3142 3142 struct zone *zone = pgdat->node_zones + i; 3143 3143 3144 - if (!populated_zone(zone)) 3144 + if (!managed_zone(zone)) 3145 3145 continue; 3146 3146 3147 3147 if (!zone_balanced(zone, order, classzone_idx)) ··· 3169 3169 sc->nr_to_reclaim = 0; 3170 3170 for (z = 0; z <= sc->reclaim_idx; z++) { 3171 3171 zone = pgdat->node_zones + z; 3172 - if (!populated_zone(zone)) 3172 + if (!managed_zone(zone)) 3173 3173 continue; 3174 3174 3175 3175 sc->nr_to_reclaim += max(high_wmark_pages(zone), SWAP_CLUSTER_MAX); ··· 3242 3242 if (buffer_heads_over_limit) { 3243 3243 for (i = MAX_NR_ZONES - 1; i >= 0; i--) { 3244 3244 zone = pgdat->node_zones + i; 3245 - if (!populated_zone(zone)) 3245 + if (!managed_zone(zone)) 3246 3246 continue; 3247 3247 3248 3248 sc.reclaim_idx = i; ··· 3262 3262 */ 3263 3263 for (i = classzone_idx; i >= 0; i--) { 3264 3264 zone = pgdat->node_zones + i; 3265 - if (!populated_zone(zone)) 3265 + if (!managed_zone(zone)) 3266 3266 continue; 3267 3267 3268 3268 if (zone_balanced(zone, sc.order, classzone_idx)) ··· 3508 3508 pg_data_t *pgdat; 3509 3509 int z; 3510 3510 3511 - if (!populated_zone(zone)) 3511 + if (!managed_zone(zone)) 3512 3512 return; 3513 3513 3514 3514 if (!cpuset_zone_allowed(zone, GFP_KERNEL | __GFP_HARDWALL)) ··· 3522 3522 /* Only wake kswapd if all zones are unbalanced */ 3523 3523 for (z = 0; z <= classzone_idx; z++) { 3524 3524 zone = pgdat->node_zones + z; 3525 - if (!populated_zone(zone)) 3525 + if (!managed_zone(zone)) 3526 3526 continue; 3527 3527 3528 3528 if (zone_balanced(zone, order, classzone_idx))
-9
scripts/checkpatch.pl
··· 3570 3570 } 3571 3571 } 3572 3572 3573 - # check for uses of DEFINE_PCI_DEVICE_TABLE 3574 - if ($line =~ /\bDEFINE_PCI_DEVICE_TABLE\s*\(\s*(\w+)\s*\)\s*=/) { 3575 - if (WARN("DEFINE_PCI_DEVICE_TABLE", 3576 - "Prefer struct pci_device_id over deprecated DEFINE_PCI_DEVICE_TABLE\n" . $herecurr) && 3577 - $fix) { 3578 - $fixed[$fixlinenr] =~ s/\b(?:static\s+|)DEFINE_PCI_DEVICE_TABLE\s*\(\s*(\w+)\s*\)\s*=\s*/static const struct pci_device_id $1\[\] = /; 3579 - } 3580 - } 3581 - 3582 3573 # check for new typedefs, only function parameters and sparse annotations 3583 3574 # make sense. 3584 3575 if ($line =~ /\btypedef\s/ &&
-1
scripts/tags.sh
··· 206 206 '/\<DEFINE_PER_CPU_SHARED_ALIGNED([^,]*, *\([[:alnum:]_]*\)/\1/v/' 207 207 '/\<DECLARE_WAIT_QUEUE_HEAD(\([[:alnum:]_]*\)/\1/v/' 208 208 '/\<DECLARE_\(TASKLET\|WORK\|DELAYED_WORK\)(\([[:alnum:]_]*\)/\2/v/' 209 - '/\<DEFINE_PCI_DEVICE_TABLE(\([[:alnum:]_]*\)/\1/v/' 210 209 '/\(^\s\)OFFSET(\([[:alnum:]_]*\)/\2/v/' 211 210 '/\(^\s\)DEFINE(\([[:alnum:]_]*\)/\2/v/' 212 211 '/\<DEFINE_HASHTABLE(\([[:alnum:]_]*\)/\1/v/'