@@ -581,11 +581,11 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma)
581
581
* sets it, so none of the operations on it need to be atomic.
582
582
*/
583
583
584
- /* Page flags: | [SECTION] | [NODE] | ZONE | [LAST_NIDPID ] | ... | FLAGS | */
584
+ /* Page flags: | [SECTION] | [NODE] | ZONE | [LAST_CPUPID ] | ... | FLAGS | */
585
585
#define SECTIONS_PGOFF ((sizeof(unsigned long)*8) - SECTIONS_WIDTH)
586
586
#define NODES_PGOFF (SECTIONS_PGOFF - NODES_WIDTH)
587
587
#define ZONES_PGOFF (NODES_PGOFF - ZONES_WIDTH)
588
- #define LAST_NIDPID_PGOFF (ZONES_PGOFF - LAST_NIDPID_WIDTH )
588
+ #define LAST_CPUPID_PGOFF (ZONES_PGOFF - LAST_CPUPID_WIDTH )
589
589
590
590
/*
591
591
* Define the bit shifts to access each section. For non-existent
@@ -595,7 +595,7 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma)
595
595
#define SECTIONS_PGSHIFT (SECTIONS_PGOFF * (SECTIONS_WIDTH != 0))
596
596
#define NODES_PGSHIFT (NODES_PGOFF * (NODES_WIDTH != 0))
597
597
#define ZONES_PGSHIFT (ZONES_PGOFF * (ZONES_WIDTH != 0))
598
- #define LAST_NIDPID_PGSHIFT (LAST_NIDPID_PGOFF * (LAST_NIDPID_WIDTH != 0))
598
+ #define LAST_CPUPID_PGSHIFT (LAST_CPUPID_PGOFF * (LAST_CPUPID_WIDTH != 0))
599
599
600
600
/* NODE:ZONE or SECTION:ZONE is used to ID a zone for the buddy allocator */
601
601
#ifdef NODE_NOT_IN_PAGE_FLAGS
@@ -617,7 +617,7 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma)
617
617
#define ZONES_MASK ((1UL << ZONES_WIDTH) - 1)
618
618
#define NODES_MASK ((1UL << NODES_WIDTH) - 1)
619
619
#define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1)
620
- #define LAST_NIDPID_MASK ((1UL << LAST_NIDPID_WIDTH ) - 1)
620
+ #define LAST_CPUPID_MASK ((1UL << LAST_CPUPID_WIDTH ) - 1)
621
621
#define ZONEID_MASK ((1UL << ZONEID_SHIFT) - 1)
622
622
623
623
static inline enum zone_type page_zonenum (const struct page * page )
@@ -661,96 +661,106 @@ static inline int page_to_nid(const struct page *page)
661
661
#endif
662
662
663
663
#ifdef CONFIG_NUMA_BALANCING
664
- static inline int nid_pid_to_nidpid (int nid , int pid )
664
+ static inline int cpu_pid_to_cpupid (int cpu , int pid )
665
665
{
666
- return ((nid & LAST__NID_MASK ) << LAST__PID_SHIFT ) | (pid & LAST__PID_MASK );
666
+ return ((cpu & LAST__CPU_MASK ) << LAST__PID_SHIFT ) | (pid & LAST__PID_MASK );
667
667
}
668
668
669
- static inline int nidpid_to_pid (int nidpid )
669
+ static inline int cpupid_to_pid (int cpupid )
670
670
{
671
- return nidpid & LAST__PID_MASK ;
671
+ return cpupid & LAST__PID_MASK ;
672
672
}
673
673
674
- static inline int nidpid_to_nid (int nidpid )
674
+ static inline int cpupid_to_cpu (int cpupid )
675
675
{
676
- return (nidpid >> LAST__PID_SHIFT ) & LAST__NID_MASK ;
676
+ return (cpupid >> LAST__PID_SHIFT ) & LAST__CPU_MASK ;
677
677
}
678
678
679
- static inline bool nidpid_pid_unset (int nidpid )
679
+ static inline int cpupid_to_nid (int cpupid )
680
680
{
681
- return nidpid_to_pid ( nidpid ) == ( -1 & LAST__PID_MASK );
681
+ return cpu_to_node ( cpupid_to_cpu ( cpupid ) );
682
682
}
683
683
684
- static inline bool nidpid_nid_unset (int nidpid )
684
+ static inline bool cpupid_pid_unset (int cpupid )
685
685
{
686
- return nidpid_to_nid ( nidpid ) == (-1 & LAST__NID_MASK );
686
+ return cpupid_to_pid ( cpupid ) == (-1 & LAST__PID_MASK );
687
687
}
688
688
689
- #ifdef LAST_NIDPID_NOT_IN_PAGE_FLAGS
690
- static inline int page_nidpid_xchg_last (struct page * page , int nid )
689
+ static inline bool cpupid_cpu_unset (int cpupid )
691
690
{
692
- return xchg ( & page -> _last_nidpid , nid );
691
+ return cpupid_to_cpu ( cpupid ) == ( -1 & LAST__CPU_MASK );
693
692
}
694
693
695
- static inline int page_nidpid_last (struct page * page )
694
+ #ifdef LAST_CPUPID_NOT_IN_PAGE_FLAGS
695
+ static inline int page_cpupid_xchg_last (struct page * page , int cpupid )
696
696
{
697
- return page -> _last_nidpid ;
697
+ return xchg ( & page -> _last_cpupid , cpupid ) ;
698
698
}
699
- static inline void page_nidpid_reset_last (struct page * page )
699
+
700
+ static inline int page_cpupid_last (struct page * page )
701
+ {
702
+ return page -> _last_cpupid ;
703
+ }
704
+ static inline void page_cpupid_reset_last (struct page * page )
700
705
{
701
- page -> _last_nidpid = -1 ;
706
+ page -> _last_cpupid = -1 ;
702
707
}
703
708
#else
704
- static inline int page_nidpid_last (struct page * page )
709
+ static inline int page_cpupid_last (struct page * page )
705
710
{
706
- return (page -> flags >> LAST_NIDPID_PGSHIFT ) & LAST_NIDPID_MASK ;
711
+ return (page -> flags >> LAST_CPUPID_PGSHIFT ) & LAST_CPUPID_MASK ;
707
712
}
708
713
709
- extern int page_nidpid_xchg_last (struct page * page , int nidpid );
714
+ extern int page_cpupid_xchg_last (struct page * page , int cpupid );
710
715
711
- static inline void page_nidpid_reset_last (struct page * page )
716
+ static inline void page_cpupid_reset_last (struct page * page )
712
717
{
713
- int nidpid = (1 << LAST_NIDPID_SHIFT ) - 1 ;
718
+ int cpupid = (1 << LAST_CPUPID_SHIFT ) - 1 ;
714
719
715
- page -> flags &= ~(LAST_NIDPID_MASK << LAST_NIDPID_PGSHIFT );
716
- page -> flags |= (nidpid & LAST_NIDPID_MASK ) << LAST_NIDPID_PGSHIFT ;
720
+ page -> flags &= ~(LAST_CPUPID_MASK << LAST_CPUPID_PGSHIFT );
721
+ page -> flags |= (cpupid & LAST_CPUPID_MASK ) << LAST_CPUPID_PGSHIFT ;
717
722
}
718
- #endif /* LAST_NIDPID_NOT_IN_PAGE_FLAGS */
719
- #else
720
- static inline int page_nidpid_xchg_last (struct page * page , int nidpid )
723
+ #endif /* LAST_CPUPID_NOT_IN_PAGE_FLAGS */
724
+ #else /* !CONFIG_NUMA_BALANCING */
725
+ static inline int page_cpupid_xchg_last (struct page * page , int cpupid )
721
726
{
722
- return page_to_nid (page );
727
+ return page_to_nid (page ); /* XXX */
723
728
}
724
729
725
- static inline int page_nidpid_last (struct page * page )
730
+ static inline int page_cpupid_last (struct page * page )
726
731
{
727
- return page_to_nid (page );
732
+ return page_to_nid (page ); /* XXX */
728
733
}
729
734
730
- static inline int nidpid_to_nid (int nidpid )
735
+ static inline int cpupid_to_nid (int cpupid )
731
736
{
732
737
return -1 ;
733
738
}
734
739
735
- static inline int nidpid_to_pid (int nidpid )
740
+ static inline int cpupid_to_pid (int cpupid )
736
741
{
737
742
return -1 ;
738
743
}
739
744
740
- static inline int nid_pid_to_nidpid (int nid , int pid )
745
+ static inline int cpupid_to_cpu (int cpupid )
741
746
{
742
747
return -1 ;
743
748
}
744
749
745
- static inline bool nidpid_pid_unset (int nidpid )
750
+ static inline int cpu_pid_to_cpupid (int nid , int pid )
751
+ {
752
+ return -1 ;
753
+ }
754
+
755
+ static inline bool cpupid_pid_unset (int cpupid )
746
756
{
747
757
return 1 ;
748
758
}
749
759
750
- static inline void page_nidpid_reset_last (struct page * page )
760
+ static inline void page_cpupid_reset_last (struct page * page )
751
761
{
752
762
}
753
- #endif
763
+ #endif /* CONFIG_NUMA_BALANCING */
754
764
755
765
static inline struct zone * page_zone (const struct page * page )
756
766
{
0 commit comments