public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nitin Gupta <ngupta@vflare.org>
To: Minchan Kim <minchan.kim@gmail.com>
Cc: Greg KH <greg@kroah.com>, Pekka Enberg <penberg@cs.helsinki.fi>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Nigel Cunningham <nigel@tuxonice.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	Hugh Dickins <hugh.dickins@tiscali.co.uk>, Cyp <cyp561@gmail.com>,
	driverdev <devel@driverdev.osuosl.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] ramzswap: Handler for swap slot free callback
Date: Tue, 18 May 2010 08:54:34 +0530	[thread overview]
Message-ID: <4BF20872.8030200@vflare.org> (raw)
In-Reply-To: <AANLkTim3XjWbIRDSFMhiowQjELM8VL547vW0ZU-LyYJb@mail.gmail.com>

On 05/17/2010 05:33 PM, Minchan Kim wrote:
> On Mon, May 17, 2010 at 2:32 PM, Nitin Gupta <ngupta@vflare.org> wrote:
>> Install handler for swap_slot_free_notify callback which is called
>> when a swap slot is no longer used. This handler immediately frees
>> memory allocated corresponding to the given swap slot.
>>
>> Signed-off-by: Nitin Gupta <ngupta@vflare.org>
>> ---
>>  drivers/staging/ramzswap/TODO           |    5 -----
>>  drivers/staging/ramzswap/ramzswap_drv.c |   22 +++++++++++++---------
>>  2 files changed, 13 insertions(+), 14 deletions(-)
>>  delete mode 100644 drivers/staging/ramzswap/TODO
>>
>> diff --git a/drivers/staging/ramzswap/TODO b/drivers/staging/ramzswap/TODO
>> deleted file mode 100644
>> index 8d64e28..0000000
>> --- a/drivers/staging/ramzswap/TODO
>> +++ /dev/null
>> @@ -1,5 +0,0 @@
>> -TODO:
>> -       - Add support for swap notifiers
>> -
>> -Please send patches to Greg Kroah-Hartman <greg@kroah.com> and
>> -Nitin Gupta <ngupta@vflare.org>
>> diff --git a/drivers/staging/ramzswap/ramzswap_drv.c b/drivers/staging/ramzswap/ramzswap_drv.c
>> index ee5eb12..ab15276 100644
>> --- a/drivers/staging/ramzswap/ramzswap_drv.c
>> +++ b/drivers/staging/ramzswap/ramzswap_drv.c
>> @@ -795,14 +795,6 @@ static int ramzswap_write(struct ramzswap *rzs, struct bio *bio)
>>
>>        src = rzs->compress_buffer;
>>
>> -       /*
>> -        * System swaps to same sector again when the stored page
>> -        * is no longer referenced by any process. So, its now safe
>> -        * to free the memory that was allocated for this page.
>> -        */
>> -       if (rzs->table[index].page || rzs_test_flag(rzs, index, RZS_ZERO))
>> -               ramzswap_free_page(rzs, index);
>> -
>>        mutex_lock(&rzs->lock);
>>
>>        user_mem = kmap_atomic(page, KM_USER0);
>> @@ -1295,9 +1287,21 @@ out:
>>        return ret;
>>  }
>>
>> +void ramzswap_slot_free_notify(struct block_device *bdev, unsigned long index)
>> +{
>> +       struct ramzswap *rzs;
>> +
>> +       rzs = bdev->bd_disk->private_data;
>> +       ramzswap_free_page(rzs, index);
>> +       rzs_stat64_inc(rzs, &rzs->stats.notify_free);
>> +
>> +       return;
>> +}
> 
> Mistake. Let's remove _return_ in void function.
> Otherwise, looks good to me.
> 

I will do this in upcoming cleanup patches.

Thanks for the review.
Nitin



  reply	other threads:[~2010-05-18  3:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-17  5:32 [PATCH 0/3] ramzswap: Eliminate stale data from compressed memory (v2 resend) Nitin Gupta
2010-05-17  5:32 ` [PATCH 1/3] Add flag to identify block swap devices Nitin Gupta
2010-05-17 11:50   ` Minchan Kim
2010-05-17 19:35     ` Hugh Dickins
2010-05-17  5:32 ` [PATCH 2/3] Add swap slot free callback to block_device_operations Nitin Gupta
2010-05-17 12:01   ` Minchan Kim
2010-05-18  3:31     ` Nitin Gupta
2010-05-17  5:32 ` [PATCH 3/3] ramzswap: Handler for swap slot free callback Nitin Gupta
2010-05-17 12:03   ` Minchan Kim
2010-05-18  3:24     ` Nitin Gupta [this message]
2010-05-17  6:10 ` [PATCH 0/3] ramzswap: Eliminate stale data from compressed memory (v2 resend) Pekka Enberg
2010-05-17  8:45   ` Nitin Gupta
  -- strict thread matches above, loose matches on Subject: below --
2010-05-07  7:25 [PATCH 0/3] ramzswap: Eliminate stale data from compressed memory (v2) Nitin Gupta
2010-05-07  7:25 ` [PATCH 3/3] ramzswap: Handler for swap slot free callback 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=4BF20872.8030200@vflare.org \
    --to=ngupta@vflare.org \
    --cc=akpm@linux-foundation.org \
    --cc=cyp561@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=greg@kroah.com \
    --cc=hugh.dickins@tiscali.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minchan.kim@gmail.com \
    --cc=nigel@tuxonice.net \
    --cc=penberg@cs.helsinki.fi \
    --cc=torvalds@linux-foundation.org \
    /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