linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] vmevent: pass right attribute to vmevent_sample_attr()
@ 2012-05-23  7:28 Bartlomiej Zolnierkiewicz
  2012-05-25  7:19 ` Pekka Enberg
  0 siblings, 1 reply; 4+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2012-05-23  7:28 UTC (permalink / raw)
  To: Pekka Enberg; +Cc: Anton Vorontsov, linux-mm

From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Subject: [PATCH] vmevent: pass right attribute to vmevent_sample_attr()

Pass "config attribute" (&watch->config->attrs[i]) not "sample
attribute" (&watch->sample_attrs[i]) to vmevent_sample_attr() to
allow use of the original attribute value in vmevent_attr_sample_fn().

Cc: Anton Vorontsov <anton.vorontsov@linaro.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
Without this patch vmevent_attr_lowmem_pages() always returns 0.

 mm/vmevent.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Index: b/mm/vmevent.c
===================================================================
--- a/mm/vmevent.c	2012-05-22 17:55:02.000000000 +0200
+++ b/mm/vmevent.c	2012-05-22 18:10:40.075231798 +0200
@@ -31,6 +31,7 @@
 	 */
 	unsigned long			nr_attrs;
 	struct vmevent_attr		*sample_attrs;
+	struct vmevent_attr		*config_attrs[VMEVENT_CONFIG_MAX_ATTRS];
 
 	/* sampling */
 	struct timer_list		timer;
@@ -104,6 +105,7 @@
 	 */
 	if (free < val && file < val)
 		return val;
+
 	return 0;
 }
 
@@ -210,7 +212,8 @@
 	for (i = 0; i < watch->nr_attrs; i++) {
 		struct vmevent_attr *attr = &watch->sample_attrs[i];
 
-		attr->value = vmevent_sample_attr(watch, attr);
+		attr->value = vmevent_sample_attr(watch,
+						  watch->config_attrs[i]);
 	}
 
 	atomic_set(&watch->pending, 1);
@@ -353,6 +356,9 @@
 		attrs[nr].type = attr->type;
 		attrs[nr].value = 0;
 		attrs[nr].state = 0;
+
+		watch->config_attrs[nr] = attr;
+
 		nr++;
 	}
 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH 2/2] vmevent: pass right attribute to vmevent_sample_attr()
  2012-05-23  7:28 [PATCH 2/2] vmevent: pass right attribute to vmevent_sample_attr() Bartlomiej Zolnierkiewicz
@ 2012-05-25  7:19 ` Pekka Enberg
  2012-05-25  8:15   ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 4+ messages in thread
From: Pekka Enberg @ 2012-05-25  7:19 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: Anton Vorontsov, linux-mm

On Wed, 23 May 2012, Bartlomiej Zolnierkiewicz wrote:

> From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> Subject: [PATCH] vmevent: pass right attribute to vmevent_sample_attr()
> 
> Pass "config attribute" (&watch->config->attrs[i]) not "sample
> attribute" (&watch->sample_attrs[i]) to vmevent_sample_attr() to
> allow use of the original attribute value in vmevent_attr_sample_fn().
> 
> Cc: Anton Vorontsov <anton.vorontsov@linaro.org>
> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

Looks good. I'm getting rejects for this. What tree did you use to 
generate the patch?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH 2/2] vmevent: pass right attribute to vmevent_sample_attr()
  2012-05-25  7:19 ` Pekka Enberg
@ 2012-05-25  8:15   ` Bartlomiej Zolnierkiewicz
  2012-05-25  9:11     ` Pekka Enberg
  0 siblings, 1 reply; 4+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2012-05-25  8:15 UTC (permalink / raw)
  To: Pekka Enberg; +Cc: Anton Vorontsov, linux-mm

On Friday 25 May 2012 09:19:45 Pekka Enberg wrote:
> On Wed, 23 May 2012, Bartlomiej Zolnierkiewicz wrote:
> 
> > From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> > Subject: [PATCH] vmevent: pass right attribute to vmevent_sample_attr()
> > 
> > Pass "config attribute" (&watch->config->attrs[i]) not "sample
> > attribute" (&watch->sample_attrs[i]) to vmevent_sample_attr() to
> > allow use of the original attribute value in vmevent_attr_sample_fn().
> > 
> > Cc: Anton Vorontsov <anton.vorontsov@linaro.org>
> > Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> 
> Looks good. I'm getting rejects for this. What tree did you use to 
> generate the patch?


Ah, sorry for that.  I generated this patch with Anton's "vmevent: Implement
special low-memory attribute" patch applied..  Here is a version against
vanilla vmevent-core:

From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Subject: [PATCH] vmevent: pass right attribute to vmevent_sample_attr()

Pass "config attribute" (&watch->config->attrs[i]) not "sample
attribute" (&watch->sample_attrs[i]) to vmevent_sample_attr() to
allow use of the original attribute value in vmevent_attr_sample_fn().

Cc: Anton Vorontsov <anton.vorontsov@linaro.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
Without this patch vmevent_attr_lowmem_pages() always returns 0.

 mm/vmevent.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Index: b/mm/vmevent.c
===================================================================
--- a/mm/vmevent.c	2012-05-25 10:13:49.000000000 +0200
+++ b/mm/vmevent.c	2012-05-25 10:13:56.231805967 +0200
@@ -31,6 +31,7 @@
 	 */
 	unsigned long			nr_attrs;
 	struct vmevent_attr		*sample_attrs;
+	struct vmevent_attr		*config_attrs[VMEVENT_CONFIG_MAX_ATTRS];
 
 	/* sampling */
 	struct timer_list		timer;
@@ -170,7 +171,8 @@
 	for (i = 0; i < watch->nr_attrs; i++) {
 		struct vmevent_attr *attr = &watch->sample_attrs[i];
 
-		attr->value = vmevent_sample_attr(watch, attr);
+		attr->value = vmevent_sample_attr(watch,
+						  watch->config_attrs[i]);
 	}
 
 	atomic_set(&watch->pending, 1);
@@ -313,6 +315,9 @@
 		attrs[nr].type = attr->type;
 		attrs[nr].value = 0;
 		attrs[nr].state = 0;
+
+		watch->config_attrs[nr] = attr;
+
 		nr++;
 	}
 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH 2/2] vmevent: pass right attribute to vmevent_sample_attr()
  2012-05-25  8:15   ` Bartlomiej Zolnierkiewicz
@ 2012-05-25  9:11     ` Pekka Enberg
  0 siblings, 0 replies; 4+ messages in thread
From: Pekka Enberg @ 2012-05-25  9:11 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: Anton Vorontsov, linux-mm

On Fri, 25 May 2012, Bartlomiej Zolnierkiewicz wrote:
> > Looks good. I'm getting rejects for this. What tree did you use to 
> > generate the patch?
> 
> Ah, sorry for that.  I generated this patch with Anton's "vmevent: Implement
> special low-memory attribute" patch applied..  Here is a version against
> vanilla vmevent-core:

Right. I think Anton is reworking his patch which is why it's not merged 
to vmevent/core.

I applied your patch, thanks!

			Pekka

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2012-05-25  9:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-23  7:28 [PATCH 2/2] vmevent: pass right attribute to vmevent_sample_attr() Bartlomiej Zolnierkiewicz
2012-05-25  7:19 ` Pekka Enberg
2012-05-25  8:15   ` Bartlomiej Zolnierkiewicz
2012-05-25  9:11     ` Pekka Enberg

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