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 tag 'trace-fixes-v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace

Pull tracing fixes from Steven Rostedt:
"Minor last minute fixes:

- Fix a very tight race between the ring buffer readers and resizing
the ring buffer

- Correct some stale comments in the ring buffer code

- Fix kernel-doc in the rv code

- Add a MODULE_DESCRIPTION to preemptirq_delay_test"

* tag 'trace-fixes-v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
rv: Update rv_en(dis)able_monitor doc to match kernel-doc
tracing: Add MODULE_DESCRIPTION() to preemptirq_delay_test
ring-buffer: Fix a race between readers and resize checks
ring-buffer: Correct stale comments related to non-consuming readers

+15 -13
+1
kernel/trace/preemptirq_delay_test.c
··· 215 215 216 216 module_init(preemptirq_delay_init) 217 217 module_exit(preemptirq_delay_exit) 218 + MODULE_DESCRIPTION("Preempt / IRQ disable delay thread to test latency tracers"); 218 219 MODULE_LICENSE("GPL v2");
+12 -13
kernel/trace/ring_buffer.c
··· 1460 1460 * 1461 1461 * As a safety measure we check to make sure the data pages have not 1462 1462 * been corrupted. 1463 + * 1464 + * Callers of this function need to guarantee that the list of pages doesn't get 1465 + * modified during the check. In particular, if it's possible that the function 1466 + * is invoked with concurrent readers which can swap in a new reader page then 1467 + * the caller should take cpu_buffer->reader_lock. 1463 1468 */ 1464 1469 static void rb_check_pages(struct ring_buffer_per_cpu *cpu_buffer) 1465 1470 { ··· 2215 2210 */ 2216 2211 synchronize_rcu(); 2217 2212 for_each_buffer_cpu(buffer, cpu) { 2213 + unsigned long flags; 2214 + 2218 2215 cpu_buffer = buffer->buffers[cpu]; 2216 + raw_spin_lock_irqsave(&cpu_buffer->reader_lock, flags); 2219 2217 rb_check_pages(cpu_buffer); 2218 + raw_spin_unlock_irqrestore(&cpu_buffer->reader_lock, flags); 2220 2219 } 2221 2220 atomic_dec(&buffer->record_disabled); 2222 2221 } ··· 5055 5046 * @flags: gfp flags to use for memory allocation 5056 5047 * 5057 5048 * This performs the initial preparations necessary to iterate 5058 - * through the buffer. Memory is allocated, buffer recording 5049 + * through the buffer. Memory is allocated, buffer resizing 5059 5050 * is disabled, and the iterator pointer is returned to the caller. 5060 - * 5061 - * Disabling buffer recording prevents the reading from being 5062 - * corrupted. This is not a consuming read, so a producer is not 5063 - * expected. 5064 5051 * 5065 5052 * After a sequence of ring_buffer_read_prepare calls, the user is 5066 5053 * expected to make at least one call to ring_buffer_read_prepare_sync. ··· 5144 5139 * ring_buffer_read_finish - finish reading the iterator of the buffer 5145 5140 * @iter: The iterator retrieved by ring_buffer_start 5146 5141 * 5147 - * This re-enables the recording to the buffer, and frees the 5148 - * iterator. 5142 + * This re-enables resizing of the buffer, and frees the iterator. 5149 5143 */ 5150 5144 void 5151 5145 ring_buffer_read_finish(struct ring_buffer_iter *iter) ··· 5152 5148 struct ring_buffer_per_cpu *cpu_buffer = iter->cpu_buffer; 5153 5149 unsigned long flags; 5154 5150 5155 - /* 5156 - * Ring buffer is disabled from recording, here's a good place 5157 - * to check the integrity of the ring buffer. 5158 - * Must prevent readers from trying to read, as the check 5159 - * clears the HEAD page and readers require it. 5160 - */ 5151 + /* Use this opportunity to check the integrity of the ring buffer. */ 5161 5152 raw_spin_lock_irqsave(&cpu_buffer->reader_lock, flags); 5162 5153 rb_check_pages(cpu_buffer); 5163 5154 raw_spin_unlock_irqrestore(&cpu_buffer->reader_lock, flags);
+2
kernel/trace/rv/rv.c
··· 245 245 246 246 /** 247 247 * rv_disable_monitor - disable a given runtime monitor 248 + * @mdef: Pointer to the monitor definition structure. 248 249 * 249 250 * Returns 0 on success. 250 251 */ ··· 257 256 258 257 /** 259 258 * rv_enable_monitor - enable a given runtime monitor 259 + * @mdef: Pointer to the monitor definition structure. 260 260 * 261 261 * Returns 0 on success, error otherwise. 262 262 */