@@ -355,8 +355,7 @@ void __mod_zone_page_state(struct zone *zone, enum zone_stat_item item,
355
355
* CPU migrations and preemption potentially corrupts a counter so
356
356
* disable preemption.
357
357
*/
358
- if (IS_ENABLED (CONFIG_PREEMPT_RT ))
359
- preempt_disable ();
358
+ preempt_disable_nested ();
360
359
361
360
x = delta + __this_cpu_read (* p );
362
361
@@ -368,8 +367,7 @@ void __mod_zone_page_state(struct zone *zone, enum zone_stat_item item,
368
367
}
369
368
__this_cpu_write (* p , x );
370
369
371
- if (IS_ENABLED (CONFIG_PREEMPT_RT ))
372
- preempt_enable ();
370
+ preempt_enable_nested ();
373
371
}
374
372
EXPORT_SYMBOL (__mod_zone_page_state );
375
373
@@ -393,8 +391,7 @@ void __mod_node_page_state(struct pglist_data *pgdat, enum node_stat_item item,
393
391
}
394
392
395
393
/* See __mod_node_page_state */
396
- if (IS_ENABLED (CONFIG_PREEMPT_RT ))
397
- preempt_disable ();
394
+ preempt_disable_nested ();
398
395
399
396
x = delta + __this_cpu_read (* p );
400
397
@@ -406,8 +403,7 @@ void __mod_node_page_state(struct pglist_data *pgdat, enum node_stat_item item,
406
403
}
407
404
__this_cpu_write (* p , x );
408
405
409
- if (IS_ENABLED (CONFIG_PREEMPT_RT ))
410
- preempt_enable ();
406
+ preempt_enable_nested ();
411
407
}
412
408
EXPORT_SYMBOL (__mod_node_page_state );
413
409
@@ -441,8 +437,7 @@ void __inc_zone_state(struct zone *zone, enum zone_stat_item item)
441
437
s8 v , t ;
442
438
443
439
/* See __mod_node_page_state */
444
- if (IS_ENABLED (CONFIG_PREEMPT_RT ))
445
- preempt_disable ();
440
+ preempt_disable_nested ();
446
441
447
442
v = __this_cpu_inc_return (* p );
448
443
t = __this_cpu_read (pcp -> stat_threshold );
@@ -453,8 +448,7 @@ void __inc_zone_state(struct zone *zone, enum zone_stat_item item)
453
448
__this_cpu_write (* p , - overstep );
454
449
}
455
450
456
- if (IS_ENABLED (CONFIG_PREEMPT_RT ))
457
- preempt_enable ();
451
+ preempt_enable_nested ();
458
452
}
459
453
460
454
void __inc_node_state (struct pglist_data * pgdat , enum node_stat_item item )
@@ -466,8 +460,7 @@ void __inc_node_state(struct pglist_data *pgdat, enum node_stat_item item)
466
460
VM_WARN_ON_ONCE (vmstat_item_in_bytes (item ));
467
461
468
462
/* See __mod_node_page_state */
469
- if (IS_ENABLED (CONFIG_PREEMPT_RT ))
470
- preempt_disable ();
463
+ preempt_disable_nested ();
471
464
472
465
v = __this_cpu_inc_return (* p );
473
466
t = __this_cpu_read (pcp -> stat_threshold );
@@ -478,8 +471,7 @@ void __inc_node_state(struct pglist_data *pgdat, enum node_stat_item item)
478
471
__this_cpu_write (* p , - overstep );
479
472
}
480
473
481
- if (IS_ENABLED (CONFIG_PREEMPT_RT ))
482
- preempt_enable ();
474
+ preempt_enable_nested ();
483
475
}
484
476
485
477
void __inc_zone_page_state (struct page * page , enum zone_stat_item item )
@@ -501,8 +493,7 @@ void __dec_zone_state(struct zone *zone, enum zone_stat_item item)
501
493
s8 v , t ;
502
494
503
495
/* See __mod_node_page_state */
504
- if (IS_ENABLED (CONFIG_PREEMPT_RT ))
505
- preempt_disable ();
496
+ preempt_disable_nested ();
506
497
507
498
v = __this_cpu_dec_return (* p );
508
499
t = __this_cpu_read (pcp -> stat_threshold );
@@ -513,8 +504,7 @@ void __dec_zone_state(struct zone *zone, enum zone_stat_item item)
513
504
__this_cpu_write (* p , overstep );
514
505
}
515
506
516
- if (IS_ENABLED (CONFIG_PREEMPT_RT ))
517
- preempt_enable ();
507
+ preempt_enable_nested ();
518
508
}
519
509
520
510
void __dec_node_state (struct pglist_data * pgdat , enum node_stat_item item )
@@ -526,8 +516,7 @@ void __dec_node_state(struct pglist_data *pgdat, enum node_stat_item item)
526
516
VM_WARN_ON_ONCE (vmstat_item_in_bytes (item ));
527
517
528
518
/* See __mod_node_page_state */
529
- if (IS_ENABLED (CONFIG_PREEMPT_RT ))
530
- preempt_disable ();
519
+ preempt_disable_nested ();
531
520
532
521
v = __this_cpu_dec_return (* p );
533
522
t = __this_cpu_read (pcp -> stat_threshold );
@@ -538,8 +527,7 @@ void __dec_node_state(struct pglist_data *pgdat, enum node_stat_item item)
538
527
__this_cpu_write (* p , overstep );
539
528
}
540
529
541
- if (IS_ENABLED (CONFIG_PREEMPT_RT ))
542
- preempt_enable ();
530
+ preempt_enable_nested ();
543
531
}
544
532
545
533
void __dec_zone_page_state (struct page * page , enum zone_stat_item item )
0 commit comments