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 from this list: send the line "unsubscribe cgroups" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




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

  Powered by Linux