Re: [PATCH -mm] remove __GFP_NO_KSWAPD fixes

2012-07-25 Thread Minchan Kim
On Wed, Jul 25, 2012 at 02:51:19PM -0400, Rik van Riel wrote:
> Turns out I missed two spots where __GFP_NO_KSWAPD is used.
> 
> The removal from the trace code is obvious, since the flag
> got removed there is no need to print it.
> 
> For mtdcore.c, now that memory compaction has been fixed,
> we should no longer see large swap storms from an attempt
> to allocate a large buffer, removing the need to specify
> __GFP_NO_KSWAPD.
> 
> Signed-off-by: Rik van Riel 
Reviewed-by: Minchan Kim 

You should have tidied up comment of the function.
I hope Andrew can do it if he see this review.

diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index fcfce24..6ff1308 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -1065,8 +1065,7 @@ EXPORT_SYMBOL_GPL(mtd_writev);
  * until the request succeeds or until the allocation size falls below
  * the system page size. This attempts to make sure it does not adversely
  * impact system performance, so when allocating more than one page, we
- * ask the memory allocator to avoid re-trying, swapping, writing back
- * or performing I/O.
+ * ask the memory allocator to avoid re-trying.
  *
  * Note, this function also makes sure that the allocated buffer is aligned to
  * the MTD device's min. I/O unit, i.e. the "mtd->writesize" value.

Thanks.

-- 
Kind regards,
Minchan Kim
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH -mm] remove __GFP_NO_KSWAPD fixes

2012-07-25 Thread Rik van Riel
Turns out I missed two spots where __GFP_NO_KSWAPD is used.

The removal from the trace code is obvious, since the flag
got removed there is no need to print it.

For mtdcore.c, now that memory compaction has been fixed,
we should no longer see large swap storms from an attempt
to allocate a large buffer, removing the need to specify
__GFP_NO_KSWAPD.

Signed-off-by: Rik van Riel 
---
 drivers/mtd/mtdcore.c   |3 +--
 include/trace/events/gfpflags.h |1 -
 2 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index 9a9ce71..af1e932 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -761,8 +761,7 @@ EXPORT_SYMBOL_GPL(mtd_writev);
  */
 void *mtd_kmalloc_up_to(const struct mtd_info *mtd, size_t *size)
 {
-   gfp_t flags = __GFP_NOWARN | __GFP_WAIT |
-  __GFP_NORETRY | __GFP_NO_KSWAPD;
+   gfp_t flags = __GFP_NOWARN | __GFP_WAIT | __GFP_NORETRY;
size_t min_alloc = max_t(size_t, mtd->writesize, PAGE_SIZE);
void *kbuf;
 
diff --git a/include/trace/events/gfpflags.h b/include/trace/events/gfpflags.h
index 9fe3a36..8ffc050 100644
--- a/include/trace/events/gfpflags.h
+++ b/include/trace/events/gfpflags.h
@@ -35,7 +35,6 @@
{(unsigned long)__GFP_RECLAIMABLE,  "GFP_RECLAIMABLE"}, \
{(unsigned long)__GFP_MOVABLE,  "GFP_MOVABLE"}, \
{(unsigned long)__GFP_NOTRACK,  "GFP_NOTRACK"}, \
-   {(unsigned long)__GFP_NO_KSWAPD,"GFP_NO_KSWAPD"},   \
{(unsigned long)__GFP_OTHER_NODE,   "GFP_OTHER_NODE"}   \
) : "GFP_NOWAIT"
 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH -mm] remove __GFP_NO_KSWAPD fixes

2012-07-25 Thread Rik van Riel
Turns out I missed two spots where __GFP_NO_KSWAPD is used.

The removal from the trace code is obvious, since the flag
got removed there is no need to print it.

For mtdcore.c, now that memory compaction has been fixed,
we should no longer see large swap storms from an attempt
to allocate a large buffer, removing the need to specify
__GFP_NO_KSWAPD.

Signed-off-by: Rik van Riel r...@redhat.com
---
 drivers/mtd/mtdcore.c   |3 +--
 include/trace/events/gfpflags.h |1 -
 2 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index 9a9ce71..af1e932 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -761,8 +761,7 @@ EXPORT_SYMBOL_GPL(mtd_writev);
  */
 void *mtd_kmalloc_up_to(const struct mtd_info *mtd, size_t *size)
 {
-   gfp_t flags = __GFP_NOWARN | __GFP_WAIT |
-  __GFP_NORETRY | __GFP_NO_KSWAPD;
+   gfp_t flags = __GFP_NOWARN | __GFP_WAIT | __GFP_NORETRY;
size_t min_alloc = max_t(size_t, mtd-writesize, PAGE_SIZE);
void *kbuf;
 
diff --git a/include/trace/events/gfpflags.h b/include/trace/events/gfpflags.h
index 9fe3a36..8ffc050 100644
--- a/include/trace/events/gfpflags.h
+++ b/include/trace/events/gfpflags.h
@@ -35,7 +35,6 @@
{(unsigned long)__GFP_RECLAIMABLE,  GFP_RECLAIMABLE}, \
{(unsigned long)__GFP_MOVABLE,  GFP_MOVABLE}, \
{(unsigned long)__GFP_NOTRACK,  GFP_NOTRACK}, \
-   {(unsigned long)__GFP_NO_KSWAPD,GFP_NO_KSWAPD},   \
{(unsigned long)__GFP_OTHER_NODE,   GFP_OTHER_NODE}   \
) : GFP_NOWAIT
 

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH -mm] remove __GFP_NO_KSWAPD fixes

2012-07-25 Thread Minchan Kim
On Wed, Jul 25, 2012 at 02:51:19PM -0400, Rik van Riel wrote:
 Turns out I missed two spots where __GFP_NO_KSWAPD is used.
 
 The removal from the trace code is obvious, since the flag
 got removed there is no need to print it.
 
 For mtdcore.c, now that memory compaction has been fixed,
 we should no longer see large swap storms from an attempt
 to allocate a large buffer, removing the need to specify
 __GFP_NO_KSWAPD.
 
 Signed-off-by: Rik van Riel r...@redhat.com
Reviewed-by: Minchan Kim minc...@kernel.org

You should have tidied up comment of the function.
I hope Andrew can do it if he see this review.

diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index fcfce24..6ff1308 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -1065,8 +1065,7 @@ EXPORT_SYMBOL_GPL(mtd_writev);
  * until the request succeeds or until the allocation size falls below
  * the system page size. This attempts to make sure it does not adversely
  * impact system performance, so when allocating more than one page, we
- * ask the memory allocator to avoid re-trying, swapping, writing back
- * or performing I/O.
+ * ask the memory allocator to avoid re-trying.
  *
  * Note, this function also makes sure that the allocated buffer is aligned to
  * the MTD device's min. I/O unit, i.e. the mtd-writesize value.

Thanks.

-- 
Kind regards,
Minchan Kim
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/