aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/kexec_core.c
AgeCommit message (Expand)Author
2017-07-18x86/mm, kexec: Allow kexec to be used with SMETom Lendacky
2017-07-12kdump: protect vmcoreinfo data under the crash memoryXunlei Pang
2017-06-30objtool, x86: Add several functions and files to the objtool whitelistJosh Poimboeuf
2017-05-08ia64: reuse append_elf_note() and final_note() functionsHari Bathini
2017-05-08crash: move crashkernel parsing and vmcore related code under CONFIG_CRASH_COREHari Bathini
2017-02-22Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/pml...Linus Torvalds
2017-02-08printk: rename nmi.c and exported apiSergey Senozhatsky
2017-01-11kexec: Switch to __pa_symbolLaura Abbott
2016-12-14kexec: add cond_resched into kimage_alloc_crash_control_pageszhong jiang
2016-12-14kexec: export the value of phys_base instead of symbol addressBaoquan He
2016-08-02kexec: add restriction on kexec_load() segment sizeszhong jiang
2016-08-02kexec: add a kexec_crash_loaded() functionPetr Tesarik
2016-08-02kexec: allow architectures to override boot mappingRussell King
2016-08-02kdump: arrange for paddr_vmcoreinfo_note() to return phys_addr_tRussell King
2016-08-02kexec: ensure user memory sizes do not wrapRussell King
2016-08-02kexec: return error number directlyMinfei Huang
2016-05-23s390/kexec: consolidate crash_map/unmap_reserved_pages() and arch_kexec_prote...Xunlei Pang
2016-05-23kexec: introduce a protection mechanism for the crashkernel reserved memoryXunlei Pang
2016-05-20printk/nmi: flush NMI messages on the system panicPetr Mladek
2016-05-19mm: rename _count, field of the struct page, to _refcountJoonsoo Kim
2016-04-28kexec: export OFFSET(page.compound_head) to find out compound tail pageAtsushi Kumagai
2016-04-28kexec: update VMCOREINFO for compound_order/dtorAtsushi Kumagai
2016-01-30kexec: Set IORESOURCE_SYSTEM_RAM for System RAMToshi Kani
2016-01-20kernel/kexec_core.c: use list_for_each_entry_safe in kimage_free_page_listGeliang Tang
2015-12-19kexec: Fix race between panic() and crash_kexec()Hidehiro Kawai
2015-11-06kexec: use file name as the output message prefixMinfei Huang
2015-10-21kexec/crash: Say which char is the unrecognizedBorislav Petkov
2015-09-10kexec: export KERNEL_IMAGE_SIZE to vmcoreinfoBaoquan He
2015-09-10kexec: align crash_notes allocation to make it be inside one physical pageBaoquan He
2015-09-10kexec: remove unnecessary test in kimage_alloc_crash_control_pages()Minfei Huang
2015-09-10kexec: split kexec_load syscall from kexec core codeDave Young
t;, producer_nice); else trace_printk("Running Producer at SCHED_FIFO %d\n", producer_fifo); /* Let the user know that the test is running at low priority */ if (producer_fifo < 0 && consumer_fifo < 0 && producer_nice == MAX_NICE && consumer_nice == MAX_NICE) trace_printk("WARNING!!! This test is running at lowest priority.\n"); trace_printk("Time: %lld (usecs)\n", time); trace_printk("Overruns: %lld\n", overruns); if (disable_reader) trace_printk("Read: (reader disabled)\n"); else trace_printk("Read: %ld (by %s)\n", read, read_events ? "events" : "pages"); trace_printk("Entries: %lld\n", entries); trace_printk("Total: %lld\n", entries + overruns + read); trace_printk("Missed: %ld\n", missed); trace_printk("Hit: %ld\n", hit); /* Convert time from usecs to millisecs */ do_div(time, USEC_PER_MSEC); if (time) hit /= (long)time; else trace_printk("TIME IS ZERO??\n"); trace_printk("Entries per millisec: %ld\n", hit); if (hit) { /* Calculate the average time in nanosecs */ avg = NSEC_PER_MSEC / hit; trace_printk("%ld ns per entry\n", avg); } if (missed) { if (time) missed /= (long)time; trace_printk("Total iterations per millisec: %ld\n", hit + missed); /* it is possible that hit + missed will overflow and be zero */ if (!(hit + missed)) { trace_printk("hit + missed overflowed and totalled zero!\n"); hit--; /* make it non zero */ } /* Caculate the average time in nanosecs */ avg = NSEC_PER_MSEC / (hit + missed); trace_printk("%ld ns per entry\n", avg); } } static void wait_to_die(void) { set_current_state(TASK_INTERRUPTIBLE); while (!kthread_should_stop()) { schedule(); set_current_state(TASK_INTERRUPTIBLE); } __set_current_state(TASK_RUNNING); } static int ring_buffer_consumer_thread(void *arg) { while (!break_test()) { complete(&read_start); ring_buffer_consumer(); set_current_state(TASK_INTERRUPTIBLE); if (break_test()) break; schedule(); } __set_current_state(TASK_RUNNING); if (!kthread_should_stop()) wait_to_die(); return 0; } static int ring_buffer_producer_thread(void *arg) { while (!break_test()) { ring_buffer_reset(buffer); if (consumer) { wake_up_process(consumer); wait_for_completion(&read_start); } ring_buffer_producer(); if (break_test()) goto out_kill; trace_printk("Sleeping for 10 secs\n"); set_current_state(TASK_INTERRUPTIBLE); if (break_test()) goto out_kill; schedule_timeout(HZ * SLEEP_TIME); } out_kill: __set_current_state(TASK_RUNNING); if (!kthread_should_stop()) wait_to_die(); return 0; } static int __init ring_buffer_benchmark_init(void) { int ret; /* make a one meg buffer in overwite mode */ buffer = ring_buffer_alloc(1000000, RB_FL_OVERWRITE); if (!buffer) return -ENOMEM; if (!disable_reader) { consumer = kthread_create(ring_buffer_consumer_thread, NULL, "rb_consumer"); ret = PTR_ERR(consumer); if (IS_ERR(consumer)) goto out_fail; } producer = kthread_run(ring_buffer_producer_thread, NULL, "rb_producer"); ret = PTR_ERR(producer); if (IS_ERR(producer)) goto out_kill; /* * Run them as low-prio background tasks by default: */ if (!disable_reader) { if (consumer_fifo >= 0) { struct sched_param param = { .sched_priority = consumer_fifo }; sched_setscheduler(consumer, SCHED_FIFO, &param); } else set_user_nice(consumer, consumer_nice); } if (producer_fifo >= 0) { struct sched_param param = { .sched_priority = producer_fifo }; sched_setscheduler(producer, SCHED_FIFO, &param); } else set_user_nice(producer, producer_nice); return 0; out_kill: if (consumer) kthread_stop(consumer); out_fail: ring_buffer_free(buffer); return ret; } static void __exit ring_buffer_benchmark_exit(void) { kthread_stop(producer); if (consumer) kthread_stop(consumer); ring_buffer_free(buffer); } module_init(ring_buffer_benchmark_init); module_exit(ring_buffer_benchmark_exit); MODULE_AUTHOR("Steven Rostedt"); MODULE_DESCRIPTION("ring_buffer_benchmark"); MODULE_LICENSE("GPL");