Re: [PATCH 1/2] vmpressure: in-kernel notifications

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04/24/2013 12:24 AM, Anton Vorontsov wrote:
On Tue, Apr 23, 2013 at 12:22:08PM +0400, Glauber Costa wrote:
From: Glauber Costa <glommer@xxxxxxxxxxxxx>

This patch extends that to also support in-kernel users. Events that
should be generated for in-kernel consumption will be marked as such,
and for those, we will call a registered function instead of triggering
an eventfd notification.

Just a couple more questions... :-)

[...]
@@ -238,14 +244,16 @@ void vmpressure(gfp_t gfp, struct mem_cgroup *memcg,
  	 * through vmpressure_prio(). But so far, keep calm.
  	 */
  	if (!scanned)
-		return;
+		goto schedule;

  	mutex_lock(&vmpr->sr_lock);
  	vmpr->scanned += scanned;
  	vmpr->reclaimed += reclaimed;
+	vmpr->notify_userspace = true;

Setting the variable on every event seems a bit wasteful... does it make
sense to set it in vmpressure_register_event()? We'll have to make it a
counter, but the good thing is that we won't need any additional locks for
the counter.

Yes, vmpressure_register_event would be a better place for it. I will change and keep the acks, since it does not change the spirit of the patch too much.

I will also apply the cosmetics you attached. Thanks

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]