public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nitin Gupta <ngupta@vflare.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Greg KH <greg@kroah.com>, Minchan Kim <minchan.kim@gmail.com>,
	Pekka Enberg <penberg@cs.helsinki.fi>,
	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 0/3] ramzswap: Eliminate stale data in compressed memory
Date: Wed, 05 May 2010 21:35:17 +0530	[thread overview]
Message-ID: <4BE1973D.5040206@vflare.org> (raw)
In-Reply-To: <alpine.LFD.2.00.1005050809490.5478@i5.linux-foundation.org>

On 05/05/2010 08:44 PM, Linus Torvalds wrote:
> 
> 
> On Wed, 5 May 2010, Nitin Gupta wrote:
>>
>> ramzswap driver creates RAM based block devices which can be
>> used (only) as swap disks. Pages swapped to these disks are
>> compressed and stored in memory itself.
> 
> Ok, this patch series looks way better, if only because it looks less 
> hacky.
> 
> That said, I absolutely _hate_ the f*cking notifier model that takes 
> "type" flags. It's a disgrace. It's a horrible horrible model.
> 

You mean you didn't like the 'swap type' value passed around by notifier
calls, as here:
 "blocking_notifier_call_chain(&swapon_notify_list, type, swap_file);" ?

> I'd much rather bind a nice "swap_operations" structure to the device, and 
> have that structure have function pointers for the different operations. 
> No stupid "operation type codes". Real, honest-to-goodness function 
> pointers.
> 

I think such 'swap_operations' structure will be have to be part of
block_device_operations, so we may access it from swap_entry_free()
where a swap slot is freed. This will also get rid of all this notifier
stuff.

The patch you nacked did something similar: it add 'swap_slot_free_callback'
directly to block_device_operations. Without such change, I could not think
of any way to do away with notifiers.


> The notifier layer is a total piece of sh*t. I'm sorry I ever merged it, 
> and I'm _doubly_ sorry that it's use is so horribly widespread. It's a 
> mistake.

Thanks,
Nitin

  reply	other threads:[~2010-05-05 16:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-05 13:45 [PATCH 0/3] ramzswap: Eliminate stale data in compressed memory Nitin Gupta
2010-05-05 13:45 ` [PATCH 1/3] Add notifiers for swapon and swapoff events Nitin Gupta
2010-05-05 13:45 ` [PATCH 2/3] Send callback when a swap slot is freed Nitin Gupta
2010-05-05 13:45 ` [PATCH 3/3] ramzswap: Register for swap event notifiers and callback Nitin Gupta
2010-05-05 15:14 ` [PATCH 0/3] ramzswap: Eliminate stale data in compressed memory Linus Torvalds
2010-05-05 16:05   ` Nitin Gupta [this message]
2010-05-05 16:22     ` Linus Torvalds
2010-05-05 16:55       ` Nitin Gupta
2010-05-05 17:50         ` Linus Torvalds
  -- strict thread matches above, loose matches on Subject: below --
2010-03-05 10:22 Nitin Gupta
2010-03-09 19:07 ` Nitin Gupta
2010-03-11  7:22 ` Hugh Dickins
2010-03-11 11:36   ` 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=4BE1973D.5040206@vflare.org \
    --to=ngupta@vflare.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=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