linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Trivial fixups
@ 2020-06-05  9:25 SeongJae Park
  2020-06-05  9:25 ` [PATCH 1/2] mm/page_idle.c: Skip offline pages SeongJae Park
  2020-06-05  9:25 ` [PATCH 2/2] scripts/spelling: Add a few more typos SeongJae Park
  0 siblings, 2 replies; 6+ messages in thread
From: SeongJae Park @ 2020-06-05  9:25 UTC (permalink / raw)
  To: akpm; +Cc: david, linux-mm, linux-kernel, SeongJae Park

From: SeongJae Park <sjpark@amazon.de>

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/20200602130125.20467-1-sjpark@amazon.com/

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(-)

-- 
2.17.1



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] mm/page_idle.c: Skip offline pages
  2020-06-05  9:25 [PATCH 0/2] Trivial fixups SeongJae Park
@ 2020-06-05  9:25 ` SeongJae Park
  2020-06-05  9:27   ` David Hildenbrand
  2020-06-05  9:31   ` Pankaj Gupta
  2020-06-05  9:25 ` [PATCH 2/2] scripts/spelling: Add a few more typos SeongJae Park
  1 sibling, 2 replies; 6+ messages in thread
From: SeongJae Park @ 2020-06-05  9:25 UTC (permalink / raw)
  To: akpm; +Cc: david, linux-mm, linux-kernel, SeongJae Park

From: SeongJae Park <sjpark@amazon.de>

'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.

Signed-off-by: SeongJae Park <sjpark@amazon.de>
Reported-by: David Hildenbrand <david@redhat.com>
---
 mm/page_idle.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/mm/page_idle.c b/mm/page_idle.c
index 295512465065..057c61df12db 100644
--- a/mm/page_idle.c
+++ b/mm/page_idle.c
@@ -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;
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] scripts/spelling: Add a few more typos
  2020-06-05  9:25 [PATCH 0/2] Trivial fixups SeongJae Park
  2020-06-05  9:25 ` [PATCH 1/2] mm/page_idle.c: Skip offline pages SeongJae Park
@ 2020-06-05  9:25 ` SeongJae Park
  2020-06-05  9:36   ` David Hildenbrand
  1 sibling, 1 reply; 6+ messages in thread
From: SeongJae Park @ 2020-06-05  9:25 UTC (permalink / raw)
  To: akpm; +Cc: david, linux-mm, linux-kernel, SeongJae Park

From: SeongJae Park <sjpark@amazon.de>

This commit adds typos I found from another works.

Signed-off-by: SeongJae Park <sjpark@amazon.de>
---
 scripts/spelling.txt | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/scripts/spelling.txt b/scripts/spelling.txt
index d9cd24cf0d40..c45e9afaab2d 100644
--- a/scripts/spelling.txt
+++ b/scripts/spelling.txt
@@ -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
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] mm/page_idle.c: Skip offline pages
  2020-06-05  9:25 ` [PATCH 1/2] mm/page_idle.c: Skip offline pages SeongJae Park
@ 2020-06-05  9:27   ` David Hildenbrand
  2020-06-05  9:31   ` Pankaj Gupta
  1 sibling, 0 replies; 6+ messages in thread
From: David Hildenbrand @ 2020-06-05  9:27 UTC (permalink / raw)
  To: SeongJae Park, akpm; +Cc: linux-mm, linux-kernel, SeongJae Park

On 05.06.20 11:25, SeongJae Park wrote:
> From: SeongJae Park <sjpark@amazon.de>
> 
> '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.
> 
> Signed-off-by: SeongJae Park <sjpark@amazon.de>
> Reported-by: David Hildenbrand <david@redhat.com>
> ---
>  mm/page_idle.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/mm/page_idle.c b/mm/page_idle.c
> index 295512465065..057c61df12db 100644
> --- a/mm/page_idle.c
> +++ b/mm/page_idle.c
> @@ -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;
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] mm/page_idle.c: Skip offline pages
  2020-06-05  9:25 ` [PATCH 1/2] mm/page_idle.c: Skip offline pages SeongJae Park
  2020-06-05  9:27   ` David Hildenbrand
@ 2020-06-05  9:31   ` Pankaj Gupta
  1 sibling, 0 replies; 6+ messages in thread
From: Pankaj Gupta @ 2020-06-05  9:31 UTC (permalink / raw)
  To: SeongJae Park
  Cc: Andrew Morton, David Hildenbrand, Linux MM, LKML, SeongJae Park

> From: SeongJae Park <sjpark@amazon.de>
>
> '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.
>
> Signed-off-by: SeongJae Park <sjpark@amazon.de>
> Reported-by: David Hildenbrand <david@redhat.com>
> ---
>  mm/page_idle.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/mm/page_idle.c b/mm/page_idle.c
> index 295512465065..057c61df12db 100644
> --- a/mm/page_idle.c
> +++ b/mm/page_idle.c
> @@ -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;

Reviewed-by: Pankaj Gupta <pankaj.gupta.linux@gmail.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] scripts/spelling: Add a few more typos
  2020-06-05  9:25 ` [PATCH 2/2] scripts/spelling: Add a few more typos SeongJae Park
@ 2020-06-05  9:36   ` David Hildenbrand
  0 siblings, 0 replies; 6+ messages in thread
From: David Hildenbrand @ 2020-06-05  9:36 UTC (permalink / raw)
  To: SeongJae Park, akpm; +Cc: linux-mm, linux-kernel, SeongJae Park

On 05.06.20 11:25, SeongJae Park wrote:
> From: SeongJae Park <sjpark@amazon.de>
> 
> This commit adds typos I found from another works.
> 
> Signed-off-by: SeongJae Park <sjpark@amazon.de>
> ---
>  scripts/spelling.txt | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/scripts/spelling.txt b/scripts/spelling.txt
> index d9cd24cf0d40..c45e9afaab2d 100644
> --- a/scripts/spelling.txt
> +++ b/scripts/spelling.txt
> @@ -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
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-06-05  9:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-05  9:25 [PATCH 0/2] Trivial fixups SeongJae Park
2020-06-05  9:25 ` [PATCH 1/2] mm/page_idle.c: Skip offline pages SeongJae Park
2020-06-05  9:27   ` David Hildenbrand
2020-06-05  9:31   ` Pankaj Gupta
2020-06-05  9:25 ` [PATCH 2/2] scripts/spelling: Add a few more typos SeongJae Park
2020-06-05  9:36   ` David Hildenbrand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).