linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* posix_fallocate question again
@ 2003-08-20 19:07 Chen, Kenneth W
  2003-08-20 19:53 ` Andrew Morton
  2003-08-20 20:46 ` Christoph Hellwig
  0 siblings, 2 replies; 7+ messages in thread
From: Chen, Kenneth W @ 2003-08-20 19:07 UTC (permalink / raw)
  To: linux-kernel

This has been brought up by Ulrich more than 3 years ago:
http://marc.theaimsgroup.com/?l=linux-kernel&m=95569775802945&w=2

Is there anytime soon that kernel 2.6 will have such functionality?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: posix_fallocate question again
  2003-08-20 19:07 posix_fallocate question again Chen, Kenneth W
@ 2003-08-20 19:53 ` Andrew Morton
  2003-08-21  9:00   ` Nikita Danilov
  2003-08-20 20:46 ` Christoph Hellwig
  1 sibling, 1 reply; 7+ messages in thread
From: Andrew Morton @ 2003-08-20 19:53 UTC (permalink / raw)
  To: Chen, Kenneth W; +Cc: linux-kernel

"Chen, Kenneth W" <kenneth.w.chen@intel.com> wrote:
>
> This has been brought up by Ulrich more than 3 years ago:
> http://marc.theaimsgroup.com/?l=linux-kernel&m=95569775802945&w=2

A decent fallocate() implementation requires that the underlying fs has a
permanent representation of blocks which are in an "allocated,
uninitialised" state.  afaik XFS is the only such filesystem.

It's a fair bit of work for what doesn't really sound a very useful
feature.  Doing it in libc is reasonable.  Probably the libc implementation
could be improved by using ioctl(FIBMAP) and O_DIRECT to mimimise IO and
CPU utilisation.

> Is there anytime soon that kernel 2.6 will have such functionality?

Nope.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: posix_fallocate question again
  2003-08-20 19:07 posix_fallocate question again Chen, Kenneth W
  2003-08-20 19:53 ` Andrew Morton
@ 2003-08-20 20:46 ` Christoph Hellwig
  2003-08-21  2:36   ` Ulrich Drepper
  1 sibling, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2003-08-20 20:46 UTC (permalink / raw)
  To: Chen, Kenneth W; +Cc: linux-kernel

On Wed, Aug 20, 2003 at 12:07:10PM -0700, Chen, Kenneth W wrote:
> This has been brought up by Ulrich more than 3 years ago:
> http://marc.theaimsgroup.com/?l=linux-kernel&m=95569775802945&w=2

Note that the design for posix_fallocate is stupid.  We really want
a 64bit len argument even on 32bit machines.

> Is there anytime soon that kernel 2.6 will have such functionality?

On XFS you can use ioctl(.., XFS_IOC_RESVSP64, ..)


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: posix_fallocate question again
  2003-08-20 20:46 ` Christoph Hellwig
@ 2003-08-21  2:36   ` Ulrich Drepper
  0 siblings, 0 replies; 7+ messages in thread
From: Ulrich Drepper @ 2003-08-21  2:36 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Chen, Kenneth W, linux-kernel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Christoph Hellwig wrote:

> Note that the design for posix_fallocate is stupid.  We really want
> a 64bit len argument even on 32bit machines.

I've submitted already a bug report for that.  *Iff* somebody implements
posix_fallocate in the kernel, use

  int posix_fallocate (int, off64_t, off64_t)

as the interface (or whatever the kernel equivalent is).

- -- 
- --------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/RDBI2ijCOnn/RHQRAkmmAKCeiC4KYsvBDV65wj/GNmPMIw9t6gCgxFSC
EkqBO4PyRhTxqhvz9dlHU08=
=BASe
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: posix_fallocate question again
  2003-08-20 19:53 ` Andrew Morton
@ 2003-08-21  9:00   ` Nikita Danilov
  2003-08-21 15:38     ` Jamie Lokier
  0 siblings, 1 reply; 7+ messages in thread
From: Nikita Danilov @ 2003-08-21  9:00 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Chen, Kenneth W, linux-kernel

Andrew Morton writes:
 > "Chen, Kenneth W" <kenneth.w.chen@intel.com> wrote:
 > >
 > > This has been brought up by Ulrich more than 3 years ago:
 > > http://marc.theaimsgroup.com/?l=linux-kernel&m=95569775802945&w=2
 > 
 > A decent fallocate() implementation requires that the underlying fs has a
 > permanent representation of blocks which are in an "allocated,
 > uninitialised" state.  afaik XFS is the only such filesystem.
 > 
 > It's a fair bit of work for what doesn't really sound a very useful
 > feature.  Doing it in libc is reasonable.  Probably the libc implementation
 > could be improved by using ioctl(FIBMAP) and O_DIRECT to mimimise IO and
 > CPU utilisation.

fallocate() will be useful when writing into file through
mmap(). Currently kernel can just drop dirtied page at any moment (if
->writepage() fails with -ENOSPC), so the only safe way to modify file
through mmap() is by using mlock().

 > 
 > > Is there anytime soon that kernel 2.6 will have such functionality?
 > 
 > Nope.
 > 

Nikita.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: posix_fallocate question again
  2003-08-21  9:00   ` Nikita Danilov
@ 2003-08-21 15:38     ` Jamie Lokier
  2003-08-21 15:47       ` Nikita Danilov
  0 siblings, 1 reply; 7+ messages in thread
From: Jamie Lokier @ 2003-08-21 15:38 UTC (permalink / raw)
  To: Nikita Danilov; +Cc: Andrew Morton, Chen, Kenneth W, linux-kernel

Nikita Danilov wrote:
> fallocate() will be useful when writing into file through
> mmap(). Currently kernel can just drop dirtied page at any moment (if
> ->writepage() fails with -ENOSPC), so the only safe way to modify file
> through mmap() is by using mlock().

Isn't msync() reliable?  I.e. will it at least report the error?

-- Jamie

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: posix_fallocate question again
  2003-08-21 15:38     ` Jamie Lokier
@ 2003-08-21 15:47       ` Nikita Danilov
  0 siblings, 0 replies; 7+ messages in thread
From: Nikita Danilov @ 2003-08-21 15:47 UTC (permalink / raw)
  To: Jamie Lokier; +Cc: Andrew Morton, Chen, Kenneth W, linux-kernel

Jamie Lokier writes:
 > Nikita Danilov wrote:
 > > fallocate() will be useful when writing into file through
 > > mmap(). Currently kernel can just drop dirtied page at any moment (if
 > > ->writepage() fails with -ENOSPC), so the only safe way to modify file
 > > through mmap() is by using mlock().
 > 
 > Isn't msync() reliable?  I.e. will it at least report the error?

Seems latest 2.6 (19 Aug change sets by Andrew Morton) got support for
this: shrink_list() set AS_ENOSPC on mapping and error will later be
returned.

 > 
 > -- Jamie

Nikita.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-08-21 15:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-20 19:07 posix_fallocate question again Chen, Kenneth W
2003-08-20 19:53 ` Andrew Morton
2003-08-21  9:00   ` Nikita Danilov
2003-08-21 15:38     ` Jamie Lokier
2003-08-21 15:47       ` Nikita Danilov
2003-08-20 20:46 ` Christoph Hellwig
2003-08-21  2:36   ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).