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 misc fixes from Andrew Morton:
"20 fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
drivers/misc/sgi-gru/grumain.c: remove bogus 0x prefix from printk
cris/arch-v32: cryptocop: print a hex number after a 0x prefix
ipack: print a hex number after a 0x prefix
block: DAC960: print a hex number after a 0x prefix
fs: exofs: print a hex number after a 0x prefix
lib/genalloc.c: start search from start of chunk
mm: memcontrol: do not recurse in direct reclaim
CREDITS: update credit information for Martin Kepplinger
proc: fix NULL dereference when reading /proc/<pid>/auxv
mm: kmemleak: ensure that the task stack is not freed during scanning
lib/stackdepot.c: bump stackdepot capacity from 16MB to 128MB
latent_entropy: raise CONFIG_FRAME_WARN by default
kconfig.h: remove config_enabled() macro
ipc: account for kmem usage on mqueue and msg
mm/slab: improve performance of gathering slabinfo stats
mm: page_alloc: use KERN_CONT where appropriate
mm/list_lru.c: avoid error-path NULL pointer deref
h8300: fix syscall restarting
kcov: properly check if we are in an interrupt
mm/slab: fix kmemcg cache creation delayed issue

+89 -51
+3 -2
CREDITS
··· 1864 1864 1865 1865 N: Martin Kepplinger 1866 1866 E: martink@posteo.de 1867 - E: martin.kepplinger@theobroma-systems.com 1867 + E: martin.kepplinger@ginzinger.com 1868 1868 W: http://www.martinkepplinger.com 1869 1869 D: mma8452 accelerators iio driver 1870 - D: Kernel cleanups 1870 + D: pegasus_notetaker input driver 1871 + D: Kernel fixes and cleanups 1871 1872 S: Garnisonstraße 26 1872 1873 S: 4020 Linz 1873 1874 S: Austria
+1 -1
arch/cris/arch-v32/drivers/cryptocop.c
··· 3149 3149 printk("print_dma_descriptors start\n"); 3150 3150 3151 3151 printk("iop:\n"); 3152 - printk("\tsid: 0x%lld\n", iop->sid); 3152 + printk("\tsid: 0x%llx\n", iop->sid); 3153 3153 3154 3154 printk("\tcdesc_out: 0x%p\n", iop->cdesc_out); 3155 3155 printk("\tcdesc_in: 0x%p\n", iop->cdesc_in);
-4
arch/h8300/include/asm/thread_info.h
··· 31 31 int cpu; /* cpu we're on */ 32 32 int preempt_count; /* 0 => preemptable, <0 => BUG */ 33 33 mm_segment_t addr_limit; 34 - struct restart_block restart_block; 35 34 }; 36 35 37 36 /* ··· 43 44 .cpu = 0, \ 44 45 .preempt_count = INIT_PREEMPT_COUNT, \ 45 46 .addr_limit = KERNEL_DS, \ 46 - .restart_block = { \ 47 - .fn = do_no_restart_syscall, \ 48 - }, \ 49 47 } 50 48 51 49 #define init_thread_info (init_thread_union.thread_info)
+1 -1
arch/h8300/kernel/signal.c
··· 79 79 unsigned int er0; 80 80 81 81 /* Always make any pending restarted system calls return -EINTR */ 82 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 82 + current->restart_block.fn = do_no_restart_syscall; 83 83 84 84 /* restore passed registers */ 85 85 #define COPY(r) do { err |= get_user(regs->r, &usc->sc_##r); } while (0)
+3 -3
arch/x86/mm/kaslr.c
··· 104 104 * consistent with the vaddr_start/vaddr_end variables. 105 105 */ 106 106 BUILD_BUG_ON(vaddr_start >= vaddr_end); 107 - BUILD_BUG_ON(config_enabled(CONFIG_X86_ESPFIX64) && 107 + BUILD_BUG_ON(IS_ENABLED(CONFIG_X86_ESPFIX64) && 108 108 vaddr_end >= EFI_VA_START); 109 - BUILD_BUG_ON((config_enabled(CONFIG_X86_ESPFIX64) || 110 - config_enabled(CONFIG_EFI)) && 109 + BUILD_BUG_ON((IS_ENABLED(CONFIG_X86_ESPFIX64) || 110 + IS_ENABLED(CONFIG_EFI)) && 111 111 vaddr_end >= __START_KERNEL_map); 112 112 BUILD_BUG_ON(vaddr_end > __START_KERNEL_map); 113 113
+2 -2
drivers/block/DAC960.c
··· 2954 2954 case DAC960_PD_Controller: 2955 2955 if (!request_region(Controller->IO_Address, 0x80, 2956 2956 Controller->FullModelName)) { 2957 - DAC960_Error("IO port 0x%d busy for Controller at\n", 2957 + DAC960_Error("IO port 0x%lx busy for Controller at\n", 2958 2958 Controller, Controller->IO_Address); 2959 2959 goto Failure; 2960 2960 } ··· 2990 2990 case DAC960_P_Controller: 2991 2991 if (!request_region(Controller->IO_Address, 0x80, 2992 2992 Controller->FullModelName)){ 2993 - DAC960_Error("IO port 0x%d busy for Controller at\n", 2993 + DAC960_Error("IO port 0x%lx busy for Controller at\n", 2994 2994 Controller, Controller->IO_Address); 2995 2995 goto Failure; 2996 2996 }
+1 -1
drivers/ipack/ipack.c
··· 178 178 idev->id_vendor, idev->id_device); 179 179 } 180 180 181 - ipack_device_attr(id_format, "0x%hhu\n"); 181 + ipack_device_attr(id_format, "0x%hhx\n"); 182 182 183 183 static DEVICE_ATTR_RO(id); 184 184 static DEVICE_ATTR_RO(id_device);
+1 -1
drivers/misc/sgi-gru/grumain.c
··· 283 283 spin_lock(&gru->gs_asid_lock); 284 284 BUG_ON((asids->mt_ctxbitmap & ctxbitmap) != ctxbitmap); 285 285 asids->mt_ctxbitmap ^= ctxbitmap; 286 - gru_dbg(grudev, "gid %d, gts %p, gms %p, ctxnum 0x%d, asidmap 0x%lx\n", 286 + gru_dbg(grudev, "gid %d, gts %p, gms %p, ctxnum %d, asidmap 0x%lx\n", 287 287 gru->gs_gid, gts, gms, gts->ts_ctxnum, gms->ms_asidmap[0]); 288 288 spin_unlock(&gru->gs_asid_lock); 289 289 spin_unlock(&gms->ms_asid_lock);
+1 -1
fs/exofs/dir.c
··· 137 137 bad_entry: 138 138 EXOFS_ERR( 139 139 "ERROR [exofs_check_page]: bad entry in directory(0x%lx): %s - " 140 - "offset=%lu, inode=0x%llu, rec_len=%d, name_len=%d\n", 140 + "offset=%lu, inode=0x%llx, rec_len=%d, name_len=%d\n", 141 141 dir->i_ino, error, (page->index<<PAGE_SHIFT)+offs, 142 142 _LLU(le64_to_cpu(p->inode_no)), 143 143 rec_len, p->name_len);
+3
fs/proc/base.c
··· 1012 1012 { 1013 1013 struct mm_struct *mm = file->private_data; 1014 1014 unsigned int nwords = 0; 1015 + 1016 + if (!mm) 1017 + return 0; 1015 1018 do { 1016 1019 nwords += 2; 1017 1020 } while (mm->saved_auxv[nwords - 2] != 0); /* AT_NULL */
+1 -1
include/asm-generic/export.h
··· 70 70 #include <generated/autoksyms.h> 71 71 72 72 #define __EXPORT_SYMBOL(sym, val, sec) \ 73 - __cond_export_sym(sym, val, sec, config_enabled(__KSYM_##sym)) 73 + __cond_export_sym(sym, val, sec, __is_defined(__KSYM_##sym)) 74 74 #define __cond_export_sym(sym, val, sec, conf) \ 75 75 ___cond_export_sym(sym, val, sec, conf) 76 76 #define ___cond_export_sym(sym, val, sec, enabled) \
+2 -3
include/linux/kconfig.h
··· 31 31 * When CONFIG_BOOGER is not defined, we generate a (... 1, 0) pair, and when 32 32 * the last step cherry picks the 2nd arg, we get a zero. 33 33 */ 34 - #define config_enabled(cfg) ___is_defined(cfg) 35 34 #define __is_defined(x) ___is_defined(x) 36 35 #define ___is_defined(val) ____is_defined(__ARG_PLACEHOLDER_##val) 37 36 #define ____is_defined(arg1_or_junk) __take_second_arg(arg1_or_junk 1, 0) ··· 40 41 * otherwise. For boolean options, this is equivalent to 41 42 * IS_ENABLED(CONFIG_FOO). 42 43 */ 43 - #define IS_BUILTIN(option) config_enabled(option) 44 + #define IS_BUILTIN(option) __is_defined(option) 44 45 45 46 /* 46 47 * IS_MODULE(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'm', 0 47 48 * otherwise. 48 49 */ 49 - #define IS_MODULE(option) config_enabled(option##_MODULE) 50 + #define IS_MODULE(option) __is_defined(option##_MODULE) 50 51 51 52 /* 52 53 * IS_REACHABLE(CONFIG_FOO) evaluates to 1 if the currently compiled
+2 -2
ipc/msgutil.c
··· 53 53 size_t alen; 54 54 55 55 alen = min(len, DATALEN_MSG); 56 - msg = kmalloc(sizeof(*msg) + alen, GFP_KERNEL); 56 + msg = kmalloc(sizeof(*msg) + alen, GFP_KERNEL_ACCOUNT); 57 57 if (msg == NULL) 58 58 return NULL; 59 59 ··· 65 65 while (len > 0) { 66 66 struct msg_msgseg *seg; 67 67 alen = min(len, DATALEN_SEG); 68 - seg = kmalloc(sizeof(*seg) + alen, GFP_KERNEL); 68 + seg = kmalloc(sizeof(*seg) + alen, GFP_KERNEL_ACCOUNT); 69 69 if (seg == NULL) 70 70 goto out_err; 71 71 *pseg = seg;
+8 -1
kernel/kcov.c
··· 53 53 /* 54 54 * We are interested in code coverage as a function of a syscall inputs, 55 55 * so we ignore code executed in interrupts. 56 + * The checks for whether we are in an interrupt are open-coded, because 57 + * 1. We can't use in_interrupt() here, since it also returns true 58 + * when we are inside local_bh_disable() section. 59 + * 2. We don't want to use (in_irq() | in_serving_softirq() | in_nmi()), 60 + * since that leads to slower generated code (three separate tests, 61 + * one for each of the flags). 56 62 */ 57 - if (!t || in_interrupt()) 63 + if (!t || (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_OFFSET 64 + | NMI_MASK))) 58 65 return; 59 66 mode = READ_ONCE(t->kcov_mode); 60 67 if (mode == KCOV_MODE_TRACE) {
+1
lib/Kconfig.debug
··· 198 198 int "Warn for stack frames larger than (needs gcc 4.4)" 199 199 range 0 8192 200 200 default 0 if KASAN 201 + default 2048 if GCC_PLUGIN_LATENT_ENTROPY 201 202 default 1024 if !64BIT 202 203 default 2048 if 64BIT 203 204 help
+2 -1
lib/genalloc.c
··· 292 292 struct gen_pool_chunk *chunk; 293 293 unsigned long addr = 0; 294 294 int order = pool->min_alloc_order; 295 - int nbits, start_bit = 0, end_bit, remain; 295 + int nbits, start_bit, end_bit, remain; 296 296 297 297 #ifndef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG 298 298 BUG_ON(in_nmi()); ··· 307 307 if (size > atomic_read(&chunk->avail)) 308 308 continue; 309 309 310 + start_bit = 0; 310 311 end_bit = chunk_size(chunk) >> order; 311 312 retry: 312 313 start_bit = algo(chunk->bits, end_bit, start_bit,
+1 -1
lib/stackdepot.c
··· 50 50 STACK_ALLOC_ALIGN) 51 51 #define STACK_ALLOC_INDEX_BITS (DEPOT_STACK_BITS - \ 52 52 STACK_ALLOC_NULL_PROTECTION_BITS - STACK_ALLOC_OFFSET_BITS) 53 - #define STACK_ALLOC_SLABS_CAP 1024 53 + #define STACK_ALLOC_SLABS_CAP 8192 54 54 #define STACK_ALLOC_MAX_SLABS \ 55 55 (((1LL << (STACK_ALLOC_INDEX_BITS)) < STACK_ALLOC_SLABS_CAP) ? \ 56 56 (1LL << (STACK_ALLOC_INDEX_BITS)) : STACK_ALLOC_SLABS_CAP)
+5 -2
mm/kmemleak.c
··· 1453 1453 1454 1454 read_lock(&tasklist_lock); 1455 1455 do_each_thread(g, p) { 1456 - scan_block(task_stack_page(p), task_stack_page(p) + 1457 - THREAD_SIZE, NULL); 1456 + void *stack = try_get_task_stack(p); 1457 + if (stack) { 1458 + scan_block(stack, stack + THREAD_SIZE, NULL); 1459 + put_task_stack(p); 1460 + } 1458 1461 } while_each_thread(g, p); 1459 1462 read_unlock(&tasklist_lock); 1460 1463 }
+2
mm/list_lru.c
··· 554 554 err = memcg_init_list_lru(lru, memcg_aware); 555 555 if (err) { 556 556 kfree(lru->node); 557 + /* Do this so a list_lru_destroy() doesn't crash: */ 558 + lru->node = NULL; 557 559 goto out; 558 560 } 559 561
+9
mm/memcontrol.c
··· 1917 1917 current->flags & PF_EXITING)) 1918 1918 goto force; 1919 1919 1920 + /* 1921 + * Prevent unbounded recursion when reclaim operations need to 1922 + * allocate memory. This might exceed the limits temporarily, 1923 + * but we prefer facilitating memory reclaim and getting back 1924 + * under the limit over triggering OOM kills in these cases. 1925 + */ 1926 + if (unlikely(current->flags & PF_MEMALLOC)) 1927 + goto force; 1928 + 1920 1929 if (unlikely(task_in_memcg_oom(current))) 1921 1930 goto nomem; 1922 1931
+9 -7
mm/page_alloc.c
··· 4224 4224 } 4225 4225 4226 4226 *p = '\0'; 4227 - printk("(%s) ", tmp); 4227 + printk(KERN_CONT "(%s) ", tmp); 4228 4228 } 4229 4229 4230 4230 /* ··· 4335 4335 free_pcp += per_cpu_ptr(zone->pageset, cpu)->pcp.count; 4336 4336 4337 4337 show_node(zone); 4338 - printk("%s" 4338 + printk(KERN_CONT 4339 + "%s" 4339 4340 " free:%lukB" 4340 4341 " min:%lukB" 4341 4342 " low:%lukB" ··· 4383 4382 K(zone_page_state(zone, NR_FREE_CMA_PAGES))); 4384 4383 printk("lowmem_reserve[]:"); 4385 4384 for (i = 0; i < MAX_NR_ZONES; i++) 4386 - printk(" %ld", zone->lowmem_reserve[i]); 4387 - printk("\n"); 4385 + printk(KERN_CONT " %ld", zone->lowmem_reserve[i]); 4386 + printk(KERN_CONT "\n"); 4388 4387 } 4389 4388 4390 4389 for_each_populated_zone(zone) { ··· 4395 4394 if (skip_free_areas_node(filter, zone_to_nid(zone))) 4396 4395 continue; 4397 4396 show_node(zone); 4398 - printk("%s: ", zone->name); 4397 + printk(KERN_CONT "%s: ", zone->name); 4399 4398 4400 4399 spin_lock_irqsave(&zone->lock, flags); 4401 4400 for (order = 0; order < MAX_ORDER; order++) { ··· 4413 4412 } 4414 4413 spin_unlock_irqrestore(&zone->lock, flags); 4415 4414 for (order = 0; order < MAX_ORDER; order++) { 4416 - printk("%lu*%lukB ", nr[order], K(1UL) << order); 4415 + printk(KERN_CONT "%lu*%lukB ", 4416 + nr[order], K(1UL) << order); 4417 4417 if (nr[order]) 4418 4418 show_migration_types(types[order]); 4419 4419 } 4420 - printk("= %lukB\n", K(total)); 4420 + printk(KERN_CONT "= %lukB\n", K(total)); 4421 4421 } 4422 4422 4423 4423 hugetlb_show_meminfo();
+28 -17
mm/slab.c
··· 233 233 spin_lock_init(&parent->list_lock); 234 234 parent->free_objects = 0; 235 235 parent->free_touched = 0; 236 + parent->num_slabs = 0; 236 237 } 237 238 238 239 #define MAKE_LIST(cachep, listp, slab, nodeid) \ ··· 967 966 * guaranteed to be valid until irq is re-enabled, because it will be 968 967 * freed after synchronize_sched(). 969 968 */ 970 - if (force_change) 969 + if (old_shared && force_change) 971 970 synchronize_sched(); 972 971 973 972 fail: ··· 1383 1382 for_each_kmem_cache_node(cachep, node, n) { 1384 1383 unsigned long active_objs = 0, num_objs = 0, free_objects = 0; 1385 1384 unsigned long active_slabs = 0, num_slabs = 0; 1385 + unsigned long num_slabs_partial = 0, num_slabs_free = 0; 1386 + unsigned long num_slabs_full; 1386 1387 1387 1388 spin_lock_irqsave(&n->list_lock, flags); 1388 - list_for_each_entry(page, &n->slabs_full, lru) { 1389 - active_objs += cachep->num; 1390 - active_slabs++; 1391 - } 1389 + num_slabs = n->num_slabs; 1392 1390 list_for_each_entry(page, &n->slabs_partial, lru) { 1393 1391 active_objs += page->active; 1394 - active_slabs++; 1392 + num_slabs_partial++; 1395 1393 } 1396 1394 list_for_each_entry(page, &n->slabs_free, lru) 1397 - num_slabs++; 1395 + num_slabs_free++; 1398 1396 1399 1397 free_objects += n->free_objects; 1400 1398 spin_unlock_irqrestore(&n->list_lock, flags); 1401 1399 1402 - num_slabs += active_slabs; 1403 1400 num_objs = num_slabs * cachep->num; 1401 + active_slabs = num_slabs - num_slabs_free; 1402 + num_slabs_full = num_slabs - 1403 + (num_slabs_partial + num_slabs_free); 1404 + active_objs += (num_slabs_full * cachep->num); 1405 + 1404 1406 pr_warn(" node %d: slabs: %ld/%ld, objs: %ld/%ld, free: %ld\n", 1405 1407 node, active_slabs, num_slabs, active_objs, num_objs, 1406 1408 free_objects); ··· 2318 2314 2319 2315 page = list_entry(p, struct page, lru); 2320 2316 list_del(&page->lru); 2317 + n->num_slabs--; 2321 2318 /* 2322 2319 * Safe to drop the lock. The slab is no longer linked 2323 2320 * to the cache. ··· 2757 2752 list_add_tail(&page->lru, &(n->slabs_free)); 2758 2753 else 2759 2754 fixup_slab_list(cachep, n, page, &list); 2755 + 2756 + n->num_slabs++; 2760 2757 STATS_INC_GROWN(cachep); 2761 2758 n->free_objects += cachep->num - page->active; 2762 2759 spin_unlock(&n->list_lock); ··· 3450 3443 3451 3444 page = list_last_entry(&n->slabs_free, struct page, lru); 3452 3445 list_move(&page->lru, list); 3446 + n->num_slabs--; 3453 3447 } 3454 3448 } 3455 3449 ··· 4107 4099 unsigned long num_objs; 4108 4100 unsigned long active_slabs = 0; 4109 4101 unsigned long num_slabs, free_objects = 0, shared_avail = 0; 4102 + unsigned long num_slabs_partial = 0, num_slabs_free = 0; 4103 + unsigned long num_slabs_full = 0; 4110 4104 const char *name; 4111 4105 char *error = NULL; 4112 4106 int node; ··· 4121 4111 check_irq_on(); 4122 4112 spin_lock_irq(&n->list_lock); 4123 4113 4124 - list_for_each_entry(page, &n->slabs_full, lru) { 4125 - if (page->active != cachep->num && !error) 4126 - error = "slabs_full accounting error"; 4127 - active_objs += cachep->num; 4128 - active_slabs++; 4129 - } 4114 + num_slabs += n->num_slabs; 4115 + 4130 4116 list_for_each_entry(page, &n->slabs_partial, lru) { 4131 4117 if (page->active == cachep->num && !error) 4132 4118 error = "slabs_partial accounting error"; 4133 4119 if (!page->active && !error) 4134 4120 error = "slabs_partial accounting error"; 4135 4121 active_objs += page->active; 4136 - active_slabs++; 4122 + num_slabs_partial++; 4137 4123 } 4124 + 4138 4125 list_for_each_entry(page, &n->slabs_free, lru) { 4139 4126 if (page->active && !error) 4140 4127 error = "slabs_free accounting error"; 4141 - num_slabs++; 4128 + num_slabs_free++; 4142 4129 } 4130 + 4143 4131 free_objects += n->free_objects; 4144 4132 if (n->shared) 4145 4133 shared_avail += n->shared->avail; 4146 4134 4147 4135 spin_unlock_irq(&n->list_lock); 4148 4136 } 4149 - num_slabs += active_slabs; 4150 4137 num_objs = num_slabs * cachep->num; 4138 + active_slabs = num_slabs - num_slabs_free; 4139 + num_slabs_full = num_slabs - (num_slabs_partial + num_slabs_free); 4140 + active_objs += (num_slabs_full * cachep->num); 4141 + 4151 4142 if (num_objs - active_objs != free_objects && !error) 4152 4143 error = "free_objects accounting error"; 4153 4144
+1
mm/slab.h
··· 432 432 struct list_head slabs_partial; /* partial list first, better asm code */ 433 433 struct list_head slabs_full; 434 434 struct list_head slabs_free; 435 + unsigned long num_slabs; 435 436 unsigned long free_objects; 436 437 unsigned int free_limit; 437 438 unsigned int colour_next; /* Per-node cache coloring */
+2
mm/vmscan.c
··· 3043 3043 sc.gfp_mask, 3044 3044 sc.reclaim_idx); 3045 3045 3046 + current->flags |= PF_MEMALLOC; 3046 3047 nr_reclaimed = do_try_to_free_pages(zonelist, &sc); 3048 + current->flags &= ~PF_MEMALLOC; 3047 3049 3048 3050 trace_mm_vmscan_memcg_reclaim_end(nr_reclaimed); 3049 3051