All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/memory-failure: unecessary amount of unmapping
@ 2021-04-20  0:28 Jane Chu
  2021-04-20  0:33   ` Dan Williams
  2021-04-20  0:48 ` HORIGUCHI NAOYA(堀口 直也)
  0 siblings, 2 replies; 4+ messages in thread
From: Jane Chu @ 2021-04-20  0:28 UTC (permalink / raw)
  To: naoya.horiguchi, dan.j.williams, dave.jiang, akpm, linux-mm,
	linux-kernel
  Cc: Jane Chu

It appears that unmap_mapping_range() actually takes a 'size' as its
third argument rather than a location, the current calling fashion
causes unecessary amount of unmapping to occur.

Fixes: 6100e34b2526e ("mm, memory_failure: Teach memory_failure() about dev_pagemap pages")
Signed-off-by: Jane Chu <jane.chu@oracle.com>
---
 mm/memory-failure.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index f7ed9559d494..85ad98c00fd9 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1368,7 +1368,7 @@ static int memory_failure_dev_pagemap(unsigned long pfn, int flags,
 		 * communicated in siginfo, see kill_proc()
 		 */
 		start = (page->index << PAGE_SHIFT) & ~(size - 1);
-		unmap_mapping_range(page->mapping, start, start + size, 0);
+		unmap_mapping_range(page->mapping, start, size, 0);
 	}
 	kill_procs(&tokill, flags & MF_MUST_KILL, !unmap_success, pfn, flags);
 	rc = 0;
-- 
2.18.4


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

* Re: [PATCH] mm/memory-failure: unecessary amount of unmapping
  2021-04-20  0:28 [PATCH] mm/memory-failure: unecessary amount of unmapping Jane Chu
@ 2021-04-20  0:33   ` Dan Williams
  2021-04-20  0:48 ` HORIGUCHI NAOYA(堀口 直也)
  1 sibling, 0 replies; 4+ messages in thread
From: Dan Williams @ 2021-04-20  0:33 UTC (permalink / raw)
  To: Jane Chu
  Cc: Naoya Horiguchi, Dave Jiang, Andrew Morton, Linux MM,
	Linux Kernel Mailing List

On Mon, Apr 19, 2021 at 5:28 PM Jane Chu <jane.chu@oracle.com> wrote:
>
> It appears that unmap_mapping_range() actually takes a 'size' as its
> third argument rather than a location,

Indeed.

> the current calling fashion
> causes unecessary amount of unmapping to occur.

s/unecessary/unnecessary/

>
> Fixes: 6100e34b2526e ("mm, memory_failure: Teach memory_failure() about dev_pagemap pages")
> Signed-off-by: Jane Chu <jane.chu@oracle.com>

Other than changelog fixup, looks good.

Reviewed-by: Dan Williams <dan.j.williams@intel.com>

> ---
>  mm/memory-failure.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> index f7ed9559d494..85ad98c00fd9 100644
> --- a/mm/memory-failure.c
> +++ b/mm/memory-failure.c
> @@ -1368,7 +1368,7 @@ static int memory_failure_dev_pagemap(unsigned long pfn, int flags,
>                  * communicated in siginfo, see kill_proc()
>                  */
>                 start = (page->index << PAGE_SHIFT) & ~(size - 1);
> -               unmap_mapping_range(page->mapping, start, start + size, 0);
> +               unmap_mapping_range(page->mapping, start, size, 0);
>         }
>         kill_procs(&tokill, flags & MF_MUST_KILL, !unmap_success, pfn, flags);
>         rc = 0;
> --
> 2.18.4
>

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

* Re: [PATCH] mm/memory-failure: unecessary amount of unmapping
@ 2021-04-20  0:33   ` Dan Williams
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Williams @ 2021-04-20  0:33 UTC (permalink / raw)
  To: Jane Chu
  Cc: Naoya Horiguchi, Dave Jiang, Andrew Morton, Linux MM,
	Linux Kernel Mailing List

On Mon, Apr 19, 2021 at 5:28 PM Jane Chu <jane.chu@oracle.com> wrote:
>
> It appears that unmap_mapping_range() actually takes a 'size' as its
> third argument rather than a location,

Indeed.

> the current calling fashion
> causes unecessary amount of unmapping to occur.

s/unecessary/unnecessary/

>
> Fixes: 6100e34b2526e ("mm, memory_failure: Teach memory_failure() about dev_pagemap pages")
> Signed-off-by: Jane Chu <jane.chu@oracle.com>

Other than changelog fixup, looks good.

Reviewed-by: Dan Williams <dan.j.williams@intel.com>

> ---
>  mm/memory-failure.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> index f7ed9559d494..85ad98c00fd9 100644
> --- a/mm/memory-failure.c
> +++ b/mm/memory-failure.c
> @@ -1368,7 +1368,7 @@ static int memory_failure_dev_pagemap(unsigned long pfn, int flags,
>                  * communicated in siginfo, see kill_proc()
>                  */
>                 start = (page->index << PAGE_SHIFT) & ~(size - 1);
> -               unmap_mapping_range(page->mapping, start, start + size, 0);
> +               unmap_mapping_range(page->mapping, start, size, 0);
>         }
>         kill_procs(&tokill, flags & MF_MUST_KILL, !unmap_success, pfn, flags);
>         rc = 0;
> --
> 2.18.4
>


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

* Re: [PATCH] mm/memory-failure: unecessary amount of unmapping
  2021-04-20  0:28 [PATCH] mm/memory-failure: unecessary amount of unmapping Jane Chu
  2021-04-20  0:33   ` Dan Williams
@ 2021-04-20  0:48 ` HORIGUCHI NAOYA(堀口 直也)
  1 sibling, 0 replies; 4+ messages in thread
From: HORIGUCHI NAOYA(堀口 直也) @ 2021-04-20  0:48 UTC (permalink / raw)
  To: Jane Chu; +Cc: dan.j.williams, dave.jiang, akpm, linux-mm, linux-kernel

On Mon, Apr 19, 2021 at 06:28:21PM -0600, Jane Chu wrote:
> It appears that unmap_mapping_range() actually takes a 'size' as its
> third argument rather than a location, the current calling fashion
> causes unecessary amount of unmapping to occur.
> 
> Fixes: 6100e34b2526e ("mm, memory_failure: Teach memory_failure() about dev_pagemap pages")
> Signed-off-by: Jane Chu <jane.chu@oracle.com>

Thanks,

Reviewed-by: Naoya Horiguchi <naoya.horiguchi@nec.com>

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

end of thread, other threads:[~2021-04-20  0:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-20  0:28 [PATCH] mm/memory-failure: unecessary amount of unmapping Jane Chu
2021-04-20  0:33 ` Dan Williams
2021-04-20  0:33   ` Dan Williams
2021-04-20  0:48 ` HORIGUCHI NAOYA(堀口 直也)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.