Re: CVS commit: src/distrib/sets

2009-12-07 Thread Masao Uebayashi
> It is posix compliant, but falls foul of a common shell bug.
> 
> http://www.gnu.org/software/hello/manual/autoconf/Shell-Substitutions.html
> 
> Avoid commands that contain unbalanced parentheses in here-documents,
> comments, or case statement patterns, as many shells mishandle them.
> For example, Bash 3.1, ksh88, pdksh 5.2.14, and Zsh 4.2.6 all
> mishandle the following valid command: 
> 
>   echo $(case x in x) echo hello;; esac)

Thanks.  I've never known this.

I wonder why we don't have ${TOOL_SH}.

Masao

-- 
Masao Uebayashi / Tombi Inc. / Tel: +81-90-9141-4635


Re: CVS commit: src/sys/arch/sparc64/dev

2009-12-07 Thread Takeshi Nakayama
>>> matthew green  wrote

> 
>Module Name:   src
>Committed By:  nakayama
>Date:  Mon Dec  7 11:14:27 UTC 2009
>
>Modified Files:
>   src/sys/arch/sparc64/dev: iommu.c
>
>Log Message:
>Avoid use of iommu_dvmamap_unload in error path.  It is too
>expensive since it contains data cache flushing.
>
>Some driver (tlp(4) with DM9201 on Netra X1) can only handle one
>DMA segment, so it was called frequently.
> 
> +   /* How can this fail?  And if it does what can we do? */
> +   err = extent_free(is->is_dvmamap, map->_dm_dvmastart, sgsize,
> +   EX_NOWAIT);
> 
> 
> this can fail almost any time.  it happens when there is no free
> memory and to free a chunk would require to split a current extent
> range into two.

Ah, OK.  I added the warning printf as well as what we do in
iommu_dvmamap_unload.

-- Takeshi Nakayama


re: CVS commit: src/sys/arch/sparc64/dev

2009-12-07 Thread matthew green

   Module Name: src
   Committed By:nakayama
   Date:Mon Dec  7 11:14:27 UTC 2009
   
   Modified Files:
src/sys/arch/sparc64/dev: iommu.c
   
   Log Message:
   Avoid use of iommu_dvmamap_unload in error path.  It is too
   expensive since it contains data cache flushing.
   
   Some driver (tlp(4) with DM9201 on Netra X1) can only handle one
   DMA segment, so it was called frequently.

+   /* How can this fail?  And if it does what can we do? */
+   err = extent_free(is->is_dvmamap, map->_dm_dvmastart, sgsize,
+   EX_NOWAIT);


this can fail almost any time.  it happens when there is no free
memory and to free a chunk would require to split a current extent
range into two.


.mrg.


Re: CVS commit: src/sys/ufs/lfs

2009-12-07 Thread Antti Kantee
On Mon Dec 07 2009 at 04:12:10 +, Eduardo Horvath wrote:
> Module Name:  src
> Committed By: eeh
> Date: Mon Dec  7 04:12:10 UTC 2009
> 
> Modified Files:
>   src/sys/ufs/lfs: lfs_bio.c lfs_vfsops.c lfs_vnops.c
> 
> Log Message:
> Fix some more hangs and deadlocks.

How can replacing reference counting by adjusting reclaim order fix
anything?

> @@ -318,11 +318,9 @@
>* vref vnodes here so that cleaner doesn't try to reuse them.
>* (see XXX comment in lfs_reserveavail)
>*/
> - mutex_enter(&vp->v_interlock);
> - lfs_vref(vp);
> + VHOLD(vp);
>   if (vp2 != NULL) {
> - mutex_enter(&vp2->v_interlock);
> - lfs_vref(vp2);
> + VHOLD(vp2);
>   }
>  
>   error = lfs_reserveavail(fs, vp, vp2, fsb);
> @@ -338,9 +336,9 @@
>   lfs_reserveavail(fs, vp, vp2, -fsb);
>  
>  done:
> - lfs_vunref(vp);
> + HOLDRELE(vp);
>   if (vp2 != NULL) {
> - lfs_vunref(vp2);
> + HOLDRELE(vp2);
>   }
>  
>   return error;

Postponing sync flushing doesn't smell like it preserves the correct
semantics.  Can you explain why it works in a bit more detail than in
the commit message?  It would be good to explain it in the comments also
so that someone trying to later read the code doesn't have to go "huh??".

> Index: src/sys/ufs/lfs/lfs_vfsops.c
> diff -u src/sys/ufs/lfs/lfs_vfsops.c:1.280 src/sys/ufs/lfs/lfs_vfsops.c:1.281
> --- src/sys/ufs/lfs/lfs_vfsops.c:1.280Tue Nov 17 17:08:57 2009
> +++ src/sys/ufs/lfs/lfs_vfsops.c  Mon Dec  7 04:12:10 2009
> @@ -1,4 +1,4 @@
> -/*   $NetBSD: lfs_vfsops.c,v 1.280 2009/11/17 17:08:57 pooka Exp $   */
> +/*   $NetBSD: lfs_vfsops.c,v 1.281 2009/12/07 04:12:10 eeh Exp $ */
>  
>  /*-
>   * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2007, 2007
> @@ -61,7 +61,7 @@
>   */
>  
>  #include 
> -__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.280 2009/11/17 17:08:57 pooka 
> Exp $");
> +__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.281 2009/12/07 04:12:10 eeh Exp 
> $");
>  
>  #if defined(_KERNEL_OPT)
>  #include "opt_lfs.h"
> @@ -1549,6 +1549,7 @@
>   vaddr_t kva;
>   off_t eof, offset, startoffset = 0;
>   size_t bytes, iobytes, skipbytes;
> + bool async = (flags & PGO_SYNCIO) == 0;
>   daddr_t lbn, blkno;
>   struct vm_page *pg;
>   struct buf *mbp, *bp;
> @@ -1778,6 +1779,14 @@
>   UVMHIST_LOG(ubchist, "skipbytes %d", skipbytes, 0,0,0);
>   }
>   UVMHIST_LOG(ubchist, "returning 0", 0,0,0,0);
> +
> + if (!async) {
> + /* Start a segment write. */
> + UVMHIST_LOG(ubchist, "flushing", 0,0,0,0);
> + mutex_enter(&lfs_lock);
> + lfs_flush(fs, 0, 1);
> + mutex_exit(&lfs_lock);
> + }
>   return (0);
>  
>  tryagain:
> 
> Index: src/sys/ufs/lfs/lfs_vnops.c
> diff -u src/sys/ufs/lfs/lfs_vnops.c:1.225 src/sys/ufs/lfs/lfs_vnops.c:1.226
> --- src/sys/ufs/lfs/lfs_vnops.c:1.225 Tue Nov 17 22:49:24 2009
> +++ src/sys/ufs/lfs/lfs_vnops.c   Mon Dec  7 04:12:10 2009
> @@ -1,4 +1,4 @@
> -/*   $NetBSD: lfs_vnops.c,v 1.225 2009/11/17 22:49:24 eeh Exp $  */
> +/*   $NetBSD: lfs_vnops.c,v 1.226 2009/12/07 04:12:10 eeh Exp $  */
>  
>  /*-
>   * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
> @@ -60,7 +60,7 @@
>   */
>  
>  #include 
> -__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.225 2009/11/17 22:49:24 eeh Exp 
> $");
> +__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.226 2009/12/07 04:12:10 eeh Exp 
> $");
>  
>  #ifdef _KERNEL_OPT
>  #include "opt_compat_netbsd.h"
> @@ -1768,7 +1768,8 @@
>   if (pg == NULL)
>   return;
>  
> - while (pg->flags & PG_BUSY) {
> + while (pg->flags & PG_BUSY &&
> + pg->uobject == &vp->v_uobj) {
>   mutex_exit(&vp->v_interlock);
>   if (sp->cbpp - sp->bpp > 1) {
>   /* Write gathered pages */
> @@ -2157,7 +2158,7 @@
>*/
>   ip->i_lfs_iflags |= LFSI_NO_GOP_WRITE;
>   r = genfs_do_putpages(vp, startoffset, endoffset,
> -ap->a_flags, &busypg);
> +ap->a_flags & ~PGO_SYNCIO, &busypg);
>   ip->i_lfs_iflags &= ~LFSI_NO_GOP_WRITE;
>   if (r != EDEADLK)
>   return r;
> 



Re: CVS commit: src/lib/libc/stdio

2009-12-07 Thread enami tsugutomo
Roy Marples  writes:

> Module Name:  src
> Committed By: roy
> Date: Wed Dec  2 11:14:47 UTC 2009
> 
> Modified Files:
>   src/lib/libc/stdio: getdelim.c
> 
> Log Message:
> Pass lint.
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.10 -r1.11 src/lib/libc/stdio/getdelim.c

-   if (newlen < off || newlen > (size_t)SSIZE_MAX + 1) {
+   if (newlen < off || newlen > SIZE_MAX) {

I guess you mean newline > SSIZE_MAX.

enami.


Re: CVS commit: src

2009-12-07 Thread Antti Kantee
On Sun Dec 06 2009 at 22:18:24 +, David Holland wrote:
> On Sat, Dec 05, 2009 at 04:29:15PM +, Antti Kantee wrote:
>  > Log Message:
>  > Remove support for NetBSD/playstation2.
> 
> Does this mean we can get rid of cross/mipsEEel-netbsd in pkgsrc?

Fine by me.  It didn't even pass "make patch" when I tried it.  After I
fixed that, complication dies with some binutils vs. bison mismatch,
which I didn't try to fix.


Re: CVS commit: src

2009-12-07 Thread Havard Eidnes
> On Sat, Dec 05, 2009 at 04:29:15PM +, Antti Kantee wrote:
>  > Log Message:
>  > Remove support for NetBSD/playstation2.
>
> Does this mean we can get rid of cross/mipsEEel-netbsd in pkgsrc?

We should :)

- HÃ¥vard