[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A89BD63.8070103@rtr.ca>
Date: Mon, 17 Aug 2009 16:28:19 -0400
From: Mark Lord <liml@....ca>
To: Greg Freemyer <greg.freemyer@...il.com>
Cc: Bill Davidsen <davidsen@....com>,
James Bottomley <James.Bottomley@...e.de>,
Arjan van de Ven <arjan@...radead.org>,
Alan Cox <alan@...rguk.ukuu.org.uk>,
Chris Worley <worleys@...il.com>,
Matthew Wilcox <matthew@....cx>,
Bryan Donlan <bdonlan@...il.com>, david@...g.hm,
Markus Trippelsdorf <markus@...ppelsdorf.de>,
Matthew Wilcox <willy@...ux.intel.com>,
Hugh Dickins <hugh.dickins@...cali.co.uk>,
Nitin Gupta <ngupta@...are.org>, Ingo Molnar <mingo@...e.hu>,
Peter Zijlstra <peterz@...radead.org>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
linux-scsi@...r.kernel.org, linux-ide@...r.kernel.org,
Linux RAID <linux-raid@...r.kernel.org>
Subject: Re: Discard support (was Re: [PATCH] swap: send callback when swap
slot is freed)
Greg Freemyer wrote:
..
> Mark, I don't believe your tool really addresses the mdraid situation,
> do you agree. ie. Since your bypassing most of the block stack,
> mdraid has no way of snooping on / adjusting the discards you are
> sending out.
..
Taking care of mounted RAID / LVM filesystems requires in-kernel TRIM
support, possibly exported via an ioctl().
Taking care of unmounted RAID / LVM filesystems is possible in userland,
but would also benefit from in-kernel support, where layouts are defined
and known better than in userland.
The XFS_TRIM was an idea that Cristoph floated, as a concept for examination.
I think something along those lines would be best, but perhaps with an
interface at the VFS layer. Something that permits a userland tool
to work like this (below) might be nearly ideal:
main() {
int fd = open(filesystem_device);
while (1) {
int g, ngroups = ioctl(fd, GET_NUMBER_OF_BLOCK_GROUPS);
for (g = 0; g < ngroups; ++g) {
ioctl(fd, TRIM_ALL_FREE_EXTENTS_OF_GROUP, g);
}
sleep(3600);
}
}
Not all filesystems have a "block group", or "allocation group" structure,
but I suspect that it's an easy mapping in most cases.
With this scheme, the kernel is absolved of the need to track/coallesce
TRIM requests entirely.
Something like that, perhaps.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists