hc
2023-11-06 e3e12f52b214121840b44c91de5b3e5af5d3eb84
kernel/mm/vmstat.c
....@@ -320,6 +320,7 @@
320320 long x;
321321 long t;
322322
323
+ preempt_disable_rt();
323324 x = delta + __this_cpu_read(*p);
324325
325326 t = __this_cpu_read(pcp->stat_threshold);
....@@ -329,6 +330,7 @@
329330 x = 0;
330331 }
331332 __this_cpu_write(*p, x);
333
+ preempt_enable_rt();
332334 }
333335 EXPORT_SYMBOL(__mod_zone_page_state);
334336
....@@ -340,6 +342,7 @@
340342 long x;
341343 long t;
342344
345
+ preempt_disable_rt();
343346 x = delta + __this_cpu_read(*p);
344347
345348 t = __this_cpu_read(pcp->stat_threshold);
....@@ -349,6 +352,7 @@
349352 x = 0;
350353 }
351354 __this_cpu_write(*p, x);
355
+ preempt_enable_rt();
352356 }
353357 EXPORT_SYMBOL(__mod_node_page_state);
354358
....@@ -381,6 +385,7 @@
381385 s8 __percpu *p = pcp->vm_stat_diff + item;
382386 s8 v, t;
383387
388
+ preempt_disable_rt();
384389 v = __this_cpu_inc_return(*p);
385390 t = __this_cpu_read(pcp->stat_threshold);
386391 if (unlikely(v > t)) {
....@@ -389,6 +394,7 @@
389394 zone_page_state_add(v + overstep, zone, item);
390395 __this_cpu_write(*p, -overstep);
391396 }
397
+ preempt_enable_rt();
392398 }
393399
394400 void __inc_node_state(struct pglist_data *pgdat, enum node_stat_item item)
....@@ -397,6 +403,7 @@
397403 s8 __percpu *p = pcp->vm_node_stat_diff + item;
398404 s8 v, t;
399405
406
+ preempt_disable_rt();
400407 v = __this_cpu_inc_return(*p);
401408 t = __this_cpu_read(pcp->stat_threshold);
402409 if (unlikely(v > t)) {
....@@ -405,6 +412,7 @@
405412 node_page_state_add(v + overstep, pgdat, item);
406413 __this_cpu_write(*p, -overstep);
407414 }
415
+ preempt_enable_rt();
408416 }
409417
410418 void __inc_zone_page_state(struct page *page, enum zone_stat_item item)
....@@ -425,6 +433,7 @@
425433 s8 __percpu *p = pcp->vm_stat_diff + item;
426434 s8 v, t;
427435
436
+ preempt_disable_rt();
428437 v = __this_cpu_dec_return(*p);
429438 t = __this_cpu_read(pcp->stat_threshold);
430439 if (unlikely(v < - t)) {
....@@ -433,6 +442,7 @@
433442 zone_page_state_add(v - overstep, zone, item);
434443 __this_cpu_write(*p, overstep);
435444 }
445
+ preempt_enable_rt();
436446 }
437447
438448 void __dec_node_state(struct pglist_data *pgdat, enum node_stat_item item)
....@@ -441,6 +451,7 @@
441451 s8 __percpu *p = pcp->vm_node_stat_diff + item;
442452 s8 v, t;
443453
454
+ preempt_disable_rt();
444455 v = __this_cpu_dec_return(*p);
445456 t = __this_cpu_read(pcp->stat_threshold);
446457 if (unlikely(v < - t)) {
....@@ -449,6 +460,7 @@
449460 node_page_state_add(v - overstep, pgdat, item);
450461 __this_cpu_write(*p, overstep);
451462 }
463
+ preempt_enable_rt();
452464 }
453465
454466 void __dec_zone_page_state(struct page *page, enum zone_stat_item item)