Skip to contentSkip to conversation

Trivial fixups

PATCH Applied SeongJae Park 3 participants 6 messages Jun 5, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Trivial fixups

From: SeongJae Park <[email protected]>

This patchset fixes a potential problem in idle page tracking and adds more typos in the scripts/spelling.txt. The problem and the typos were found during my DAMON[1] work.

This patchset is based on next/akpm.

[1] https://lore.kernel.org/linux-mm/[email protected]/

SeongJae Park (2):
mm/page_idle.c: Skip offline pages
scripts/spelling: Add a few more typos

 mm/page_idle.c       | 7 ++-----
 scripts/spelling.txt | 9 +++++++++
 2 files changed, 11 insertions(+), 5 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/2 mm/page_idle.c: Skip offline pages

From: SeongJae Park <[email protected]>

'Idle page tracking' users can pass random pfn that might be mapped to an offline page. To avoid accessing such pages, this commit modifies the 'page_idle_get_page()' to use 'pfn_to_online_page()' instead of 'pfn_valid()' and 'pfn_to_page()' combination, so that the pfn mapped to an offline page can be skipped.

---
 mm/page_idle.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
mm/page_idle.c +2 -5
index 295512465065..057c61df12db 100644
@@ -4,6 +4,7 @@
 #include <linux/fs.h>
 #include <linux/sysfs.h>
 #include <linux/kobject.h>
+#include <linux/memory_hotplug.h>
 #include <linux/mm.h>
 #include <linux/mmzone.h>
 #include <linux/pagemap.h>
@@ -30,13 +31,9 @@
  */
 static struct page *page_idle_get_page(unsigned long pfn)
 {
-	struct page *page;
+	struct page *page = pfn_to_online_page(pfn);
 	pg_data_t *pgdat;
 
-	if (!pfn_valid(pfn))
-		return NULL;
-
-	page = pfn_to_page(pfn);
 	if (!page || !PageLRU(page) ||
 	    !get_page_unless_zero(page))
 		return NULL;
Signature · 1 line
2.17.1
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] mm/page_idle.c: Skip offline pages

Quoted 32 lines · SeongJae Park

From: SeongJae Park <[email protected]>

'Idle page tracking' users can pass random pfn that might be mapped to an offline page. To avoid accessing such pages, this commit modifies the 'page_idle_get_page()' to use 'pfn_to_online_page()' instead of 'pfn_valid()' and 'pfn_to_page()' combination, so that the pfn mapped to an offline page can be skipped.

---
 mm/page_idle.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
mm/page_idle.c +1 -1
index 295512465065..057c61df12db 100644
@@ -4,6 +4,7 @@
 #include <linux/fs.h>
 #include <linux/sysfs.h>
 #include <linux/kobject.h>
+#include <linux/memory_hotplug.h>
 #include <linux/mm.h>
 #include <linux/mmzone.h>
 #include <linux/pagemap.h>
@@ -30,13 +31,9 @@
  */
 static struct page *page_idle_get_page(unsigned long pfn)
 {
-	struct page *page;

mm/page_idle.c line 39

Quoted 10 lines
mm/page_idle.c +1 -4
+	struct page *page = pfn_to_online_page(pfn);
 	pg_data_t *pgdat;
 
-	if (!pfn_valid(pfn))
-		return NULL;
-
-	page = pfn_to_page(pfn);
 	if (!page || !PageLRU(page) ||
 	    !get_page_unless_zero(page))
 		return NULL;
Signature · 3 lines
Thanks,

David / dhildenb
Reviewed-by on v1 1/2
#3 lore raw

Re: [PATCH 1/2] mm/page_idle.c: Skip offline pages

In reply to SeongJae Park
Quoted 31 lines

From: SeongJae Park <[email protected]>

'Idle page tracking' users can pass random pfn that might be mapped to an offline page. To avoid accessing such pages, this commit modifies the 'page_idle_get_page()' to use 'pfn_to_online_page()' instead of 'pfn_valid()' and 'pfn_to_page()' combination, so that the pfn mapped to an offline page can be skipped.

---
 mm/page_idle.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
mm/page_idle.c +1 -1
index 295512465065..057c61df12db 100644
@@ -4,6 +4,7 @@
 #include <linux/fs.h>
 #include <linux/sysfs.h>
 #include <linux/kobject.h>
+#include <linux/memory_hotplug.h>
 #include <linux/mm.h>
 #include <linux/mmzone.h>
 #include <linux/pagemap.h>
@@ -30,13 +31,9 @@
  */
 static struct page *page_idle_get_page(unsigned long pfn)
 {
-       struct page *page;

mm/page_idle.c line 39

Quoted 10 lines
mm/page_idle.c +1 -4
+       struct page *page = pfn_to_online_page(pfn);
        pg_data_t *pgdat;
 
-       if (!pfn_valid(pfn))
-               return NULL;
-
-       page = pfn_to_page(pfn);
        if (!page || !PageLRU(page) ||
            !get_page_unless_zero(page))
                return NULL;
#4 lore raw

PATCH 2/2 scripts/spelling: Add a few more typos

In reply to SeongJae Park

From: SeongJae Park <[email protected]>

This commit adds typos I found from another works.

---
 scripts/spelling.txt | 9 +++++++++
 1 file changed, 9 insertions(+)
scripts/spelling.txt +9 -0
index d9cd24cf0d40..c45e9afaab2d 100644
@@ -59,6 +59,7 @@ actualy||actually
 acumulating||accumulating
 acumulative||accumulative
 acumulator||accumulator
+acutally||actually
 adapater||adapter
 addional||additional
 additionaly||additionally
@@ -249,6 +250,7 @@ calescing||coalescing
 calle||called
 callibration||calibration
 callled||called
+callser||caller
 calucate||calculate
 calulate||calculate
 cancelation||cancellation
@@ -671,6 +673,7 @@ hanlde||handle
 hanled||handled
 happend||happened
 harware||hardware
+havind||having
 heirarchically||hierarchically
 helpfull||helpful
 hexdecimal||hexadecimal
@@ -845,6 +848,7 @@ logile||logfile
 loobpack||loopback
 loosing||losing
 losted||lost
+maangement||management
 machinary||machinery
 maibox||mailbox
 maintainance||maintenance
@@ -905,6 +909,7 @@ modfiy||modify
 modulues||modules
 momery||memory
 memomry||memory
+monitring||monitoring
 monochorome||monochrome
 monochromo||monochrome
 monocrome||monochrome
@@ -1010,6 +1015,7 @@ partiton||partition
 pased||passed
 passin||passing
 pathes||paths
+pattrns||patterns
 pecularities||peculiarities
 peformance||performance
 peforming||performing
@@ -1256,6 +1262,7 @@ shoule||should
 shrinked||shrunk
 siginificantly||significantly
 signabl||signal
+significanly||significantly
 similary||similarly
 similiar||similar
 simlar||similar
@@ -1371,6 +1378,7 @@ thead||thread
 therfore||therefore
 thier||their
 threds||threads
+threee||three
 threshhold||threshold
 thresold||threshold
 throught||through
@@ -1410,6 +1418,7 @@ tyep||type
 udpate||update
 uesd||used
 uknown||unknown
+usccess||success
 usupported||unsupported
 uncommited||uncommitted
 unconditionaly||unconditionally
Signature · 1 line
2.17.1
Reviewed-by on v1 2/2
#5 lore raw

Re: [PATCH 2/2] scripts/spelling: Add a few more typos

Quoted 79 lines · SeongJae Park

From: SeongJae Park <[email protected]>

This commit adds typos I found from another works.

---
 scripts/spelling.txt | 9 +++++++++
 1 file changed, 9 insertions(+)
scripts/spelling.txt +8 -0
index d9cd24cf0d40..c45e9afaab2d 100644
@@ -59,6 +59,7 @@ actualy||actually
 acumulating||accumulating
 acumulative||accumulative
 acumulator||accumulator
+acutally||actually
 adapater||adapter
 addional||additional
 additionaly||additionally
@@ -249,6 +250,7 @@ calescing||coalescing
 calle||called
 callibration||calibration
 callled||called
+callser||caller
 calucate||calculate
 calulate||calculate
 cancelation||cancellation
@@ -671,6 +673,7 @@ hanlde||handle
 hanled||handled
 happend||happened
 harware||hardware
+havind||having
 heirarchically||hierarchically
 helpfull||helpful
 hexdecimal||hexadecimal
@@ -845,6 +848,7 @@ logile||logfile
 loobpack||loopback
 loosing||losing
 losted||lost
+maangement||management
 machinary||machinery
 maibox||mailbox
 maintainance||maintenance
@@ -905,6 +909,7 @@ modfiy||modify
 modulues||modules
 momery||memory
 memomry||memory
+monitring||monitoring
 monochorome||monochrome
 monochromo||monochrome
 monocrome||monochrome
@@ -1010,6 +1015,7 @@ partiton||partition
 pased||passed
 passin||passing
 pathes||paths
+pattrns||patterns
 pecularities||peculiarities
 peformance||performance
 peforming||performing
@@ -1256,6 +1262,7 @@ shoule||should
 shrinked||shrunk
 siginificantly||significantly
 signabl||signal
+significanly||significantly
 similary||similarly
 similiar||similar
 simlar||similar
@@ -1371,6 +1378,7 @@ thead||thread
 therfore||therefore
 thier||their
 threds||threads
+threee||three
 threshhold||threshold
 thresold||threshold
 throught||through

scripts/spelling.txt tyep||type · line 1424

Quoted 7 lines
scripts/spelling.txt +1 -0
@@ -1410,6 +1418,7 @@ tyep||type
 udpate||update
 uesd||used
 uknown||unknown
+usccess||success
 usupported||unsupported
 uncommited||uncommitted
 unconditionaly||unconditionally
Signature · 3 lines
Thanks,

David / dhildenb