CVS commit: src/sys/fs/puffs

2021-12-03 Thread Masatake Daimon
Module Name:src
Committed By:   pho
Date:   Fri Dec  3 13:08:10 UTC 2021

Modified Files:
src/sys/fs/puffs: puffs_msgif.h

Log Message:
Avoid using register_t in 

The purpose of this header file is to interface between the
kernel-space and user-space, and is #include'd by a user-space header
. It should therefore not use any of kernel-only types, as
it's not reasonable to require user-land filesystems to #define
_KERNTYPES.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/sys/fs/puffs/puffs_msgif.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/fs/puffs/puffs_msgif.h
diff -u src/sys/fs/puffs/puffs_msgif.h:1.86 src/sys/fs/puffs/puffs_msgif.h:1.87
--- src/sys/fs/puffs/puffs_msgif.h:1.86	Mon Mar  8 17:34:30 2021
+++ src/sys/fs/puffs/puffs_msgif.h	Fri Dec  3 13:08:10 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_msgif.h,v 1.86 2021/03/08 17:34:30 christos Exp $	*/
+/*	$NetBSD: puffs_msgif.h,v 1.87 2021/12/03 13:08:10 pho Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -705,7 +705,7 @@ struct puffs_vnmsg_pathconf {
 	struct puffs_req	pvn_pr;
 
 	int			pvnr_name;		/* OUT	*/
-	register_t		pvnr_retval;		/* IN	*/
+	__register_t		pvnr_retval;		/* IN	*/
 };
 
 struct puffs_vnmsg_advlock {



CVS commit: src/sys/fs/puffs

2021-12-03 Thread Masatake Daimon
Module Name:src
Committed By:   pho
Date:   Fri Dec  3 13:08:10 UTC 2021

Modified Files:
src/sys/fs/puffs: puffs_msgif.h

Log Message:
Avoid using register_t in 

The purpose of this header file is to interface between the
kernel-space and user-space, and is #include'd by a user-space header
. It should therefore not use any of kernel-only types, as
it's not reasonable to require user-land filesystems to #define
_KERNTYPES.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/sys/fs/puffs/puffs_msgif.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/fs/puffs

2019-09-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 27 22:36:57 UTC 2019

Modified Files:
src/sys/fs/puffs: puffs_vfsops.c

Log Message:
Fix copying issue that was causing errors in unit_test puffs_tstavfs by
removing code.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/sys/fs/puffs/puffs_vfsops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/fs/puffs

2019-09-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 27 22:36:57 UTC 2019

Modified Files:
src/sys/fs/puffs: puffs_vfsops.c

Log Message:
Fix copying issue that was causing errors in unit_test puffs_tstavfs by
removing code.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/sys/fs/puffs/puffs_vfsops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/fs/puffs/puffs_vfsops.c
diff -u src/sys/fs/puffs/puffs_vfsops.c:1.122 src/sys/fs/puffs/puffs_vfsops.c:1.123
--- src/sys/fs/puffs/puffs_vfsops.c:1.122	Mon Sep 23 08:00:57 2019
+++ src/sys/fs/puffs/puffs_vfsops.c	Fri Sep 27 18:36:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_vfsops.c,v 1.122 2019/09/23 12:00:57 christos Exp $	*/
+/*	$NetBSD: puffs_vfsops.c,v 1.123 2019/09/27 22:36:57 christos Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: puffs_vfsops.c,v 1.122 2019/09/23 12:00:57 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_vfsops.c,v 1.123 2019/09/27 22:36:57 christos Exp $");
 
 #include 
 #include 
@@ -501,14 +501,9 @@ puffs_vfsop_statvfs(struct mount *mp, st
 	 *
 	 * XXX: cache the copy in non-error case
 	 */
+	copy_statvfs_info(sbp, mp);
 	if (!error) {
-		struct statvfs *sb = STATVFSBUF_GET();
-		puffs_statvfs_to_statvfs(_msg->pvfsr_sb, sb);
-		copy_statvfs_info(sb, mp);
-		STATVFSBUF_PUT(sb);
 		statvfs_to_puffs_statvfs(sbp, _msg->pvfsr_sb);
-	} else {
-		copy_statvfs_info(sbp, mp);
 	}
 
 	PUFFS_MSG_RELEASE(statvfs);



Re: CVS commit: src/sys/fs/puffs

2014-10-15 Thread David Laight
On Tue, Oct 07, 2014 at 12:40:04AM +0700, Robert Elz wrote:
 Date:Mon, 6 Oct 2014 14:26:44 +
 From:Havard Eidnes h...@netbsd.org
 Message-ID:  20141006142644.7693...@cvs.netbsd.org
 
   | Make this build again without debugging enabled; DPRINTF() can end up
   | as empty, and in an if conditional, you then need braces if that's the
   | only potential body.
 
 That change makes no sense to me - the original code was
 
   if (error)
   DPRINTF(());
 
 and even if DPRINTF() could produce nothing, the result would be
 
   if (error)
   ;
 
 which is perfectly good C (useless, but acceptable).  Adding { } around
 the ';' changes nothing.

Consider what happens if you write:
if (error)
DPRINTF((...));
else
fubar();

When DPRINTF() expands 'if (xxx) yyy' it all goes horribly wrong.

Do we need to support any compilers that don't support __VA_ARGS__ ?
Even microsoft's compiler almost supports it.

David

-- 
David Laight: da...@l8s.co.uk


Re: CVS commit: src/sys/fs/puffs

2014-10-15 Thread Alan Barrett

On Wed, 15 Oct 2014, David Laight wrote:

Consider what happens if you write:
if (error)
DPRINTF((...));
else
fubar();

When DPRINTF() expands 'if (xxx) yyy' it all goes horribly wrong.


That's why I changed it to

do { if (xxx) yyy; } while (0)

a week or two ago.  (That change was not pulled up to netbsd-7, 
although other changes made around the same time were pulled up.)



Do we need to support any compilers that don't support __VA_ARGS__ ?
Even microsoft's compiler almost supports it.


I don't know.

--apb (Alan Barrett)


Re: CVS commit: src/sys/fs/puffs

2014-10-15 Thread Robert Elz
Date:Wed, 15 Oct 2014 19:41:40 +0100
From:David Laight da...@l8s.co.uk
Message-ID:  20141015184140.gl23...@snowdrop.l8s.co.uk

  | Consider what happens if you write:
  | When DPRINTF() expands 'if (xxx) yyy' it all goes horribly wrong.

Of course, the do { } while(0) wrapping is needed in the DPRINTF
expansion - that was also added - that's there to deal with problems
just like that.   WIth that, DPRINTF() acts just like a function
(except it has no value of course) for syntax purposes, and doesn't
need to be surrounded with {} every time it is used.

kre



Re: CVS commit: src/sys/fs/puffs

2014-10-06 Thread Robert Elz
Date:Mon, 6 Oct 2014 14:26:44 +
From:Havard Eidnes h...@netbsd.org
Message-ID:  20141006142644.7693...@cvs.netbsd.org

  | Make this build again without debugging enabled; DPRINTF() can end up
  | as empty, and in an if conditional, you then need braces if that's the
  | only potential body.

That change makes no sense to me - the original code was

if (error)
DPRINTF(());

and even if DPRINTF() could produce nothing, the result would be

if (error)
;

which is perfectly good C (useless, but acceptable).  Adding { } around
the ';' changes nothing.

But in any case, apb changed it yesterday, so DPRINTF() never produces
nothing (personally I'm not sure that should have been needed, but that's
beside the point).

What was the error that resulted in the addition of the {} ?

lre



Re: CVS commit: src/sys/fs/puffs

2014-10-06 Thread Havard Eidnes
   | Make this build again without debugging enabled; DPRINTF() can end up
   | as empty, and in an if conditional, you then need braces if that's the
   | only potential body.

 That change makes no sense to me - the original code was

   if (error)
   DPRINTF(());

 and even if DPRINTF() could produce nothing, the result would be

   if (error)
   ;

 which is perfectly good C (useless, but acceptable).  Adding { } around
 the ';' changes nothing.

Well...

compile  puffs/puffs_vnops.o
/u/build/HEAD/src/sys/fs/puffs/puffs_vnops.c: In function 'zerofill_lastpage':
/u/build/HEAD/src/sys/fs/puffs/puffs_vnops.c:1160:70: error: suggest braces 
around empty body in an 'if' statement [-Werror=empty-body]
   DPRINTF((zero-fill 0x%lx@0x% PRIx64  = %d\n, len, off, error));
  ^
cc1: all warnings being treated as errors

*** Failed target:  puffs_vnops.o

 But in any case, apb changed it yesterday, so DPRINTF() never produces
 nothing (personally I'm not sure that should have been needed, but that's
 beside the point).

Ah.  It's quite possible that my latest update was from before
that commit.

 What was the error that resulted in the addition of the {} ?

See above.

Regards,

- Håvard


Re: CVS commit: src/sys/fs/puffs

2014-10-05 Thread Alistair Crooks
On Sun, Oct 05, 2014 at 02:13:15PM +, Alan Barrett wrote:
  #ifdef PUFFSDEBUG
  extern int puffsdebug; /* puffs_subr.c */
 -#define DPRINTF(x) if (puffsdebug  0) printf x
 -#define DPRINTF_VERBOSE(x) if (puffsdebug  1) printf x
 +#define DPRINTF(x) do { \
 + if (puffsdebug  0) printf x; \
 + while (/*CONSTCOND*/0)

I think it'd be even more safe to close the block with a '}' before the
while.

 +#define DPRINTF_VERBOSE(x) do { \
 + if (puffsdebug  1) printf x; \
 + while (/*CONSTCOND*/0)

Here too.

  #else
 -#define DPRINTF(x)
 -#define DPRINTF_VERBOSE(x)
 +#define DPRINTF(x) ((void)0)
 +#define DPRINTF_VERBOSE(x) ((void)0)
  #endif
  
  #define MPTOPUFFSMP(mp) ((struct puffs_mount *)((mp)-mnt_data))

(I must admit, not compile-tested) 

Regards,
Alistair


Re: CVS commit: src/sys/fs/puffs

2012-07-23 Thread Emmanuel Dreyfus
David Holland dholland-sourcechan...@netbsd.org wrote:

   Di not call cache_enter with path components bigger than NCHNAMLEN, as it
   panics the kernel.
 
 This is wrong; you're reverting rmind's cleanup.

I backed out the change. Will someone pullup the change to netbsd-6?

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
m...@netbsd.org


Re: CVS commit: src/sys/fs/puffs

2012-07-23 Thread David Holland
On Mon, Jul 23, 2012 at 10:07:06PM +, Martin Husemann wrote:
This is wrong; you're reverting rmind's cleanup.
   
   I backed out the change. Will someone pullup the change to netbsd-6?

Can you prepare a patch that applies before rmind's cleanup? (Or just
one that applies on netbsd-6?)

OTOH for netbsd-6 maybe a better patch would be to change cache_enter
to return instead of asserting for long filenames.

  (not sure if this is related)
  
  Unfortunately even after the backout a test run still fails reproducably
  for me - see kern/46734.

Doesn't look particularly related to me. Do you know which test kills
it? (I guess post it to the PR, not here...)

-- 
David A. Holland
dholl...@netbsd.org


Re: CVS commit: src/sys/fs/puffs

2012-07-23 Thread Emmanuel Dreyfus
David Holland dholland-sourcechan...@netbsd.org wrote:

 OTOH for netbsd-6 maybe a better patch would be to change cache_enter
 to return instead of asserting for long filenames.

If nobody opposes, I can do that.

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
m...@netbsd.org


Re: CVS commit: src/sys/fs/puffs

2012-07-23 Thread David Holland
On Tue, Jul 24, 2012 at 07:13:34AM +0200, Emmanuel Dreyfus wrote:
   OTOH for netbsd-6 maybe a better patch would be to change cache_enter
   to return instead of asserting for long filenames.
  
  If nobody opposes, I can do that.

Best to ask on tech-kern, but it seems unlikely to be controversial.
It's hiding bugs but only in the sense that the interface was
stupid; and it's probable that puffs isn't the only fs missing the
check.

-- 
David A. Holland
dholl...@netbsd.org


Re: CVS commit: src/sys/fs/puffs

2011-10-18 Thread Jukka Ruohonen
On Tue, Oct 18, 2011 at 03:39:10PM +, Emmanuel Dreyfus wrote:
 Module Name:  src
 Committed By: manu
 Date: Tue Oct 18 15:39:09 UTC 2011
 
 Modified Files:
   src/sys/fs/puffs: puffs_msgif.c puffs_node.c puffs_vfsops.c
   puffs_vnops.c
 
 Log Message:
 Make sure pagedaemon does not sleep for memory in puffs_vnop_sleep.
 Add KASSERT on any sleeping memory allocation to check it cannot happen again.

+#ifdef DIAGNOSTIC
+   KASSERT(curlwp != uvm.pagedaemon_lwp);
+#endif

Why pollute code with redundant #ifdefs?

- Jukka.


Re: CVS commit: src/sys/fs/puffs

2011-10-18 Thread Emmanuel Dreyfus
Jukka Ruohonen jruoho...@iki.fi wrote:

 +#ifdef DIAGNOSTIC
 +   KASSERT(curlwp != uvm.pagedaemon_lwp);
 +#endif
 
 Why pollute code with redundant #ifdefs?

Right, I missed the point that KASSERT contains #ifdef DIAGNOSTIC. I
will fix that tomorrow morning.

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
m...@netbsd.org


Re: CVS commit: src/sys/fs/puffs

2011-10-12 Thread YAMAMOTO Takashi
hi,

 YAMAMOTO Takashi y...@mwd.biglobe.ne.jp wrote:
 
 if it trapped forever, it's a bug and should be fixed.  my point was
 that your change didn't fix the bug.  blocking ioflush is merely a symptom.
 
 The problem with userland filesystems is that we may have little control
 as theses may be third pary programs. Should kernel threads trust theses
 processes in order to run as intended?

i guess it depends.

is ioflush blocking forever worse than a userland application
blocking forever?  it depends.

even if it's a problem, it isn't a problem specific to userland filesystems.
filesystems have varying performance and reliability.

 
 One way to fix that may be to have one ioflush thread for each userland
 filesystem. That way a broken filesystem will not prevent ioflush from
 working for others. But we have hit similar problems with others kernel
 threads.

sure, it can be a good idea.

YAMAMOTO Takashi

 
 -- 
 Emmanuel Dreyfus
 http://hcpnet.free.fr/pubz
 m...@netbsd.org


Re: CVS commit: src/sys/fs/puffs

2011-10-12 Thread Emmanuel Dreyfus
On Wed, Oct 12, 2011 at 06:02:05AM +, YAMAMOTO Takashi wrote:
  One way to fix that may be to have one ioflush thread for each userland
  filesystem. That way a broken filesystem will not prevent ioflush from
  working for others. 
 
 sure, it can be a good idea.

I have a patch that does that, I will clean it up and post it.

-- 
Emmanuel Dreyfus
m...@netbsd.org


Re: CVS commit: src/sys/fs/puffs

2011-10-11 Thread YAMAMOTO Takashi
hi,

 YAMAMOTO Takashi y...@mwd.biglobe.ne.jp wrote:
 
  Sure ioflush do not directly free memory, but vnodes' dirty page use
  memory, don't they? If ioflush stops working, is pageadaemon able to
  pageout that kind of memory? 
 pagedaemon flushes dirty pages by itself, yes.
 
 So this is not a problem to get ioflush traped forever awaiting for a
 VOP_FSYNC completion? There must be some drawback, otherwise ioflush
 would be useless.

if it trapped forever, it's a bug and should be fixed.  my point was
that your change didn't fix the bug.  blocking ioflush is merely a symptom.

on the other hand, it needlessly introduced a limitation on what kernel
threads can do.  now we have vdrain_thread which i think can hit the
LW_SYSTEM assertion in puffs_vnop_fsync.

 
 a possible solution would be local page recycling.  ie. reserve some pages
 and put them onto a page queue dedicated for a given set of processes
 so that pages can be recycled in the set independently from the global queue.
 
 But we do not know how much memory the userland fileserver is going to
 require. We can have some reserves, but we must be ready to kill pigs if
 too much memory is retained by the fileserver. HEAD does it, but
 netbsd-5 prefers to hang.

you don't need to know how much memory the server will use.
when the server runs out of the reserved set of pages, you can reuse
pages in the set.

YAMAMOTO Takashi

 
 -- 
 Emmanuel Dreyfus
 http://hcpnet.free.fr/pubz
 m...@netbsd.org


Re: CVS commit: src/sys/fs/puffs

2011-10-11 Thread Emmanuel Dreyfus
YAMAMOTO Takashi y...@mwd.biglobe.ne.jp wrote:

 if it trapped forever, it's a bug and should be fixed.  my point was
 that your change didn't fix the bug.  blocking ioflush is merely a symptom.

The problem with userland filesystems is that we may have little control
as theses may be third pary programs. Should kernel threads trust theses
processes in order to run as intended?

One way to fix that may be to have one ioflush thread for each userland
filesystem. That way a broken filesystem will not prevent ioflush from
working for others. But we have hit similar problems with others kernel
threads.

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
m...@netbsd.org


Re: CVS commit: src/sys/fs/puffs

2011-09-26 Thread Emmanuel Dreyfus
On Sat, Sep 24, 2011 at 03:31:02AM +, YAMAMOTO Takashi wrote:
 pagedaemon flushes dirty pages by itself, yes.

I added a printf() at the beginning of puffs_vnop_strategy() to check for
calls by kernel threads. Only ioflush calls puffs_vnop_strategy(), 
pagedaemon never goes there. This may explain why the system cannot cope 
with PUFFS and memory shortage.

An interesting point: if I use PDPOLICY_CLOCKPRO, then pagedaemon does
call  puffs_vnop_strategy(), through the path below. I understand this is
the way it is supposed to work:
  puffs_vnop_strategy
  VOP_STRATEGY
  genfs_do_io
  genfs_gop_write
  genfs_do_putpages
  genfs_putpages
  VOP_PUTPAGES (through pgo-pgo_put)
  uvm_pageout

The system still gets stuck after a while, with glusterfsd sleeping forever
in flt_noram1. ddb' show uvmexp shows 3 free pages, 509 paging. If I 
understand correctly, pagedaemon performs an asynchronous VOP_STRATEGY 
and count an operation stuck in the PUFFS filesystem as paging. It decides
to do more work if uvmexp.free + uvmexp.paging gets too low. therefore
with many PUFFS page forever in the paging count, pagedaemon will not help
us.

I have a patch that maintain a count of paging to remote filesystems (that
is, the one that do not have MNT_LOCAL in struct mount mnt_flag), and 
substract it from  uvmexp.paging when pagedaemon has to decide whether to 
send more pages to the swap. It seems to work fine, but the system hang 
with perfused awaiting for km_getwait2 (from sys_write/putter_fop_write)

-- 
Emmanuel Dreyfus
m...@netbsd.org


Re: CVS commit: src/sys/fs/puffs

2011-09-23 Thread Emmanuel Dreyfus
YAMAMOTO Takashi y...@mwd.biglobe.ne.jp wrote:

  This avoids deadlocks in the following situations:
  1) when memory is low: ioflush waits the fileystem, the fielsystem waits
 for memory 
 can you explain how it is a problem?

As I understand, one way to free memory is to flush vnode backed pages
to the backend storage. If ioflush calls VOP_FSYNC on a memory-starved
userland filesystem, it will get stuck until the filesystem gets memory
again, and while it is stuck, it does not help freeing memory.

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
m...@netbsd.org


Re: CVS commit: src/sys/fs/puffs

2011-09-23 Thread YAMAMOTO Takashi
hi,

 YAMAMOTO Takashi y...@mwd.biglobe.ne.jp wrote:
 
  This avoids deadlocks in the following situations:
  1) when memory is low: ioflush waits the fileystem, the fielsystem waits
 for memory 
 can you explain how it is a problem?
 
 As I understand, one way to free memory is to flush vnode backed pages
 to the backend storage. If ioflush calls VOP_FSYNC on a memory-starved
 userland filesystem, it will get stuck until the filesystem gets memory
 again, and while it is stuck, it does not help freeing memory.

as i told you a few times, ioflush is not a thread to free memory.
pagedaemon is.  please read ufs_bmaparray and grep uvm.pagedaemon_lwp
in src/sys/kern/ to see what other filesystems do.  i don't think this
approach works for puffs because it's almost impossible to say in which
cases an operation needs memory allocation to complete, though.

YAMAMOTO Takashi

 
 -- 
 Emmanuel Dreyfus
 http://hcpnet.free.fr/pubz
 m...@netbsd.org


Re: CVS commit: src/sys/fs/puffs

2011-09-23 Thread Emmanuel Dreyfus
YAMAMOTO Takashi y...@mwd.biglobe.ne.jp wrote:

 as i told you a few times, ioflush is not a thread to free memory.
 pagedaemon is. 

Sure ioflush do not directly free memory, but vnodes' dirty page use
memory, don't they? If ioflush stops working, is pageadaemon able to
pageout that kind of memory?

 please read ufs_bmaparray and grep uvm.pagedaemon_lwp
 in src/sys/kern/ to see what other filesystems do.  i don't think this
 approach works for puffs because it's almost impossible to say in which
 cases an operation needs memory allocation to complete, though.

It is indeed impossible, as we cannot know what the userland filesystem
will do.

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
m...@netbsd.org


Re: CVS commit: src/sys/fs/puffs

2011-09-23 Thread YAMAMOTO Takashi
hi,

 YAMAMOTO Takashi y...@mwd.biglobe.ne.jp wrote:
 
 as i told you a few times, ioflush is not a thread to free memory.
 pagedaemon is. 
 
 Sure ioflush do not directly free memory, but vnodes' dirty page use
 memory, don't they? If ioflush stops working, is pageadaemon able to
 pageout that kind of memory?

pagedaemon flushes dirty pages by itself, yes.

 
 please read ufs_bmaparray and grep uvm.pagedaemon_lwp
 in src/sys/kern/ to see what other filesystems do.  i don't think this
 approach works for puffs because it's almost impossible to say in which
 cases an operation needs memory allocation to complete, though.
 
 It is indeed impossible, as we cannot know what the userland filesystem
 will do.

a possible solution would be local page recycling.  ie. reserve some pages
and put them onto a page queue dedicated for a given set of processes
so that pages can be recycled in the set independently from the global queue.

YAMAMOTO Takashi

 
 -- 
 Emmanuel Dreyfus
 http://hcpnet.free.fr/pubz
 m...@netbsd.org


Re: CVS commit: src/sys/fs/puffs

2011-09-23 Thread Emmanuel Dreyfus
YAMAMOTO Takashi y...@mwd.biglobe.ne.jp wrote:

  Sure ioflush do not directly free memory, but vnodes' dirty page use
  memory, don't they? If ioflush stops working, is pageadaemon able to
  pageout that kind of memory? 
 pagedaemon flushes dirty pages by itself, yes.

So this is not a problem to get ioflush traped forever awaiting for a
VOP_FSYNC completion? There must be some drawback, otherwise ioflush
would be useless.

 a possible solution would be local page recycling.  ie. reserve some pages
 and put them onto a page queue dedicated for a given set of processes
 so that pages can be recycled in the set independently from the global queue.

But we do not know how much memory the userland fileserver is going to
require. We can have some reserves, but we must be ready to kill pigs if
too much memory is retained by the fileserver. HEAD does it, but
netbsd-5 prefers to hang.

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
m...@netbsd.org


Re: CVS commit: src/sys/fs/puffs

2011-09-22 Thread YAMAMOTO Takashi
hi,

 Module Name:  src
 Committed By: manu
 Date: Wed Sep 21 15:36:33 UTC 2011
 
 Modified Files:
   src/sys/fs/puffs: puffs_vfsops.c puffs_vnops.c
 
 Log Message:
 Make sure ioflush does not sleep in PUFFS code path, waiting for a mutex,
 a memory allocation, or a response from the filesystem.
 
 This avoids deadlocks in the following situations:
 1) when memory is low: ioflush waits the fileystem, the fielsystem waits
for memory

can you explain how it is a problem?

YAMAMOTO Takashi

 2) when the filesystem does not respond (e.g.: network outage ona
distributed filesystem)
 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.96 -r1.97 src/sys/fs/puffs/puffs_vfsops.c
 cvs rdiff -u -r1.155 -r1.156 src/sys/fs/puffs/puffs_vnops.c
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.


Re: CVS commit: src/sys/fs/puffs

2011-01-11 Thread Antti Kantee
On Tue Jan 11 2011 at 14:04:54 +, Mihai Chelaru wrote:
 Module Name:  src
 Committed By: kefren
 Date: Tue Jan 11 14:04:54 UTC 2011
 
 Modified Files:
   src/sys/fs/puffs: puffs_sys.h puffs_vnops.c
 
 Log Message:
 add advlock to puffs. ok pooka@
 should fix kern/43321

Thanks!  This is a big improvement and fixes the problem in most cases.

However, e.g. for distributed file systems it would be good to have
an additional mode where the server can decide the locking policy.
I'll bump the PR state to analyzed to indicate progress.

-- 
älä karot toivorikkauttas, kyl rätei ja lumpui piisaa


Re: CVS commit: src/sys/fs/puffs

2010-07-15 Thread David Holland
On Wed, Jul 14, 2010 at 02:07:37PM +, Antti Kantee wrote:
  Modified Files:
   src/sys/fs/puffs: puffs_vnops.c
  
  Log Message:
  RENAME lookup semantics say return EISDIR if dvp = *vpp for the
  last component  obviously(!!)

I take it that when you say *vpp, you mean tvp?

(the alphabet soup effect is why I have been looking for better names
for this crud)

also I think the case you actually changed should be EINVAL?

-- 
David A. Holland
dholl...@netbsd.org


Re: CVS commit: src/sys/fs/puffs

2010-07-15 Thread Antti Kantee
On Thu Jul 15 2010 at 20:03:37 +, David Holland wrote:
 On Wed, Jul 14, 2010 at 02:07:37PM +, Antti Kantee wrote:
   Modified Files:
  src/sys/fs/puffs: puffs_vnops.c
   
   Log Message:
   RENAME lookup semantics say return EISDIR if dvp = *vpp for the
   last component  obviously(!!)
 
 I take it that when you say *vpp, you mean tvp?

Of course not.  That error comes from lookup to avoid do_sys_rename()
overriding it.

 (the alphabet soup effect is why I have been looking for better names
 for this crud)
 
 also I think the case you actually changed should be EINVAL?

I don't care as long as they're all the same (and nothing breaks ;).


CVS commit: src/sys/fs/puffs

2010-01-14 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Jan 14 14:44:13 UTC 2010

Modified Files:
src/sys/fs/puffs: puffs_vnops.c

Log Message:
Since VOP_GETATTR() does not require a locked vnode, resolve and
reference the puffs_node before sending the request to the file
server.  This diminishes the window where the inode can be reclaimed
and be invalidated before it is accessed (but does not completely
eliminate the race, as that is a caller problem which we cannot
fix here).


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/sys/fs/puffs/puffs_vnops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/fs/puffs

2010-01-07 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Jan  7 22:45:31 UTC 2010

Modified Files:
src/sys/fs/puffs: puffs_msgif.c puffs_msgif.h puffs_sys.h

Log Message:
Add a PUFFS_UNMOUNT server-kernel request, which causes the kernel
to initiate self destruct, i.e. unmount(MNT_FORCE).  This, however,
is a semi-controlled self-destruct, since all caches are flushed
before the (possibly) violent unmount takes place.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/fs/puffs/puffs_msgif.c
cvs rdiff -u -r1.68 -r1.69 src/sys/fs/puffs/puffs_msgif.h
cvs rdiff -u -r1.73 -r1.74 src/sys/fs/puffs/puffs_sys.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/fs/puffs

2010-01-07 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Jan  7 22:59:27 UTC 2010

Modified Files:
src/sys/fs/puffs: puffs_msgif.c

Log Message:
Fix variable name in my commit tree too.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/fs/puffs/puffs_msgif.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.