public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nitin Gupta <ngupta@vflare.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH] swap: send callback when swap slot is freed
Date: Wed, 12 Aug 2009 18:59:42 +0530	[thread overview]
Message-ID: <4A82C3C6.5010302@vflare.org> (raw)
In-Reply-To: <20090812125617.GA30476@elte.hu>

On 08/12/2009 06:26 PM, Ingo Molnar wrote:
> * Nitin Gupta<ngupta@vflare.org>  wrote:
>
>> (Re-sending since I didn't get any reply last time)
>>
>> Currently, we have "swap discard" mechanism which sends a discard
>> bio request when we find a free cluster during scan_swap_map().
>> This callback can come a long time after swap slots are actually
>> freed.
>>
>> This delay in callback is a great problem when (compressed) RAM
>> [1] is used as a swap device. So, this change adds a callback
>> which is called as soon as a swap slot becomes free. For above
>> mentioned case of swapping over compressed RAM device, this is
>> very useful since we can immediately free memory allocated for
>> this swap page.
>>
>> This callback does not replace swap discard support. It is called
>> with swap_lock held, so it is meant to trigger action that
>> finishes quickly. However, swap discard is an I/O request and can
>> be used for taking longer actions.

<snip>

>
> Shouldnt this be all be unconditional? Sounds like a reasonable VM
> callback. The patch would become a lot smaller as well.
>


I also think this can be made unconditional as it makes the patch
much cleaner. I made it conditional just to be on path of least
resistance :)

Thanks for looking into this. I will resend the patch removing
all the #ifdef'ery.

Nitin

  reply	other threads:[~2009-08-12 13:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-12 12:47 [RFC][PATCH] swap: send callback when swap slot is freed Nitin Gupta
2009-08-12 12:56 ` Ingo Molnar
2009-08-12 13:29   ` Nitin Gupta [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-08-10 14:37 Nitin Gupta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A82C3C6.5010302@vflare.org \
    --to=ngupta@vflare.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox