From owner-svn-src-stable-6@FreeBSD.ORG Mon Sep 7 13:58:27 2009 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54AE9106566B; Mon, 7 Sep 2009 13:58:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 426578FC15; Mon, 7 Sep 2009 13:58:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n87DwRI6016562; Mon, 7 Sep 2009 13:58:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n87DwRYP016560; Mon, 7 Sep 2009 13:58:27 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200909071358.n87DwRYP016560@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 7 Sep 2009 13:58:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196925 - in stable/6/sys: . conf contrib/pf dev/cxgb ufs/ffs X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2009 13:58:27 -0000 Author: kib Date: Mon Sep 7 13:58:26 2009 New Revision: 196925 URL: http://svn.freebsd.org/changeset/base/196925 Log: MFC r196206. Take the number of allocated freeblks into consideration for softdep_slowdown(). Tested by: pluknet gmail com Modified: stable/6/sys/ (props changed) stable/6/sys/conf/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) stable/6/sys/ufs/ffs/ffs_softdep.c Modified: stable/6/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/6/sys/ufs/ffs/ffs_softdep.c Mon Sep 7 13:37:04 2009 (r196924) +++ stable/6/sys/ufs/ffs/ffs_softdep.c Mon Sep 7 13:58:26 2009 (r196925) @@ -668,6 +668,8 @@ static int req_clear_inodedeps; /* synce static int req_clear_remove; /* syncer process flush some freeblks */ #define FLUSH_REMOVE 2 #define FLUSH_REMOVE_WAIT 3 +static long num_freeblkdep; /* number of freeblks workitems allocated */ + /* * runtime statistics */ @@ -2195,6 +2197,9 @@ softdep_setup_freeblocks(ip, length, fla freeblks->fb_uid = ip->i_uid; freeblks->fb_previousinum = ip->i_number; freeblks->fb_devvp = ip->i_devvp; + ACQUIRE_LOCK(&lk); + num_freeblkdep++; + FREE_LOCK(&lk); extblocks = 0; if (fs->fs_magic == FS_UFS2_MAGIC) extblocks = btodb(fragroundup(fs, ip->i_din2->di_extsize)); @@ -2784,6 +2789,7 @@ handle_workitem_freeblocks(freeblks, fla ACQUIRE_LOCK(&lk); WORKITEM_FREE(freeblks, D_FREEBLKS); + num_freeblkdep--; FREE_LOCK(&lk); } @@ -5708,7 +5714,8 @@ softdep_slowdown(vp) max_softdeps_hard = max_softdeps * 11 / 10; if (num_dirrem < max_softdeps_hard / 2 && num_inodedep < max_softdeps_hard && - VFSTOUFS(vp->v_mount)->um_numindirdeps < maxindirdeps) { + VFSTOUFS(vp->v_mount)->um_numindirdeps < maxindirdeps && + num_freeblkdep < max_softdeps_hard) { FREE_LOCK(&lk); return (0); } From owner-svn-src-stable-6@FreeBSD.ORG Tue Sep 8 14:15:15 2009 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 481CA106568F; Tue, 8 Sep 2009 14:15:15 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 35DBF8FC1C; Tue, 8 Sep 2009 14:15:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n88EFF4v049885; Tue, 8 Sep 2009 14:15:15 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n88EFF4R049882; Tue, 8 Sep 2009 14:15:15 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200909081415.n88EFF4R049882@svn.freebsd.org> From: Attilio Rao Date: Tue, 8 Sep 2009 14:15:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196972 - stable/6/usr.sbin/tzsetup X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2009 14:15:15 -0000 Author: attilio Date: Tue Sep 8 14:15:14 2009 New Revision: 196972 URL: http://svn.freebsd.org/changeset/base/196972 Log: MFC r195339: Add a new option (-s) that, when specified, skips the question about adjusting the clock to UTC. Sponsored by: Sandvine Incorporated Modified: stable/6/usr.sbin/tzsetup/tzsetup.8 stable/6/usr.sbin/tzsetup/tzsetup.c Modified: stable/6/usr.sbin/tzsetup/tzsetup.8 ============================================================================== --- stable/6/usr.sbin/tzsetup/tzsetup.8 Tue Sep 8 13:24:36 2009 (r196971) +++ stable/6/usr.sbin/tzsetup/tzsetup.8 Tue Sep 8 14:15:14 2009 (r196972) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd January 24, 1996 +.Dd September 08, 2009 .Dt TZSETUP 8 .Os .Sh NAME @@ -31,7 +31,7 @@ .Nd set local timezone .Sh SYNOPSIS .Nm -.Op Fl n +.Op Fl ns .Op Ar default .Sh DESCRIPTION The @@ -51,6 +51,9 @@ The following option is available: .Bl -tag -offset indent -width Fl .It Fl n Do not create or copy files. +.It Fl s +Skip the initial question about adjusting the clock if not set to +.Tn UTC . .El .Pp It is possible to short-circuit the menu system by specifying a Modified: stable/6/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- stable/6/usr.sbin/tzsetup/tzsetup.c Tue Sep 8 13:24:36 2009 (r196971) +++ stable/6/usr.sbin/tzsetup/tzsetup.c Tue Sep 8 14:15:14 2009 (r196972) @@ -648,11 +648,14 @@ main(int argc, char **argv) dialog_utc = dialog_noyes; #endif - while ((c = getopt(argc, argv, "n")) != -1) { + while ((c = getopt(argc, argv, "ns")) != -1) { switch(c) { case 'n': reallydoit = 0; break; + case 's': + dialog_utc = NULL; + break; default: usage(); @@ -671,22 +674,25 @@ main(int argc, char **argv) make_menus(); init_dialog(); - if (!dialog_utc("Select local or UTC (Greenwich Mean Time) clock", - "Is this machine's CMOS clock set to UTC? If it is set to local time,\n" - "or you don't know, please choose NO here!", 7, 72)) { - if (reallydoit) - unlink(_PATH_WALL_CMOS_CLOCK); - } else { - if (reallydoit) { - fd = open(_PATH_WALL_CMOS_CLOCK, - O_WRONLY|O_CREAT|O_TRUNC, - S_IRUSR|S_IRGRP|S_IROTH); - if (fd < 0) - err(1, "create %s", _PATH_WALL_CMOS_CLOCK); - close(fd); + if (dialog_utc != NULL) { + if (!dialog_utc("Select local or UTC (Greenwich Mean Time) clock", + "Is this machine's CMOS clock set to UTC? If it is set to local time,\n" + "or you don't know, please choose NO here!", 7, 72)) { + if (reallydoit) + unlink(_PATH_WALL_CMOS_CLOCK); + } else { + if (reallydoit) { + fd = open(_PATH_WALL_CMOS_CLOCK, + O_WRONLY|O_CREAT|O_TRUNC, + S_IRUSR|S_IRGRP|S_IROTH); + if (fd < 0) + err(1, "create %s", + _PATH_WALL_CMOS_CLOCK); + close(fd); + } } + dialog_clear_norefresh(); } - dialog_clear_norefresh(); if (optind == argc - 1) { char *msg; asprintf(&msg, "\nUse the default `%s' zone?", argv[optind]); From owner-svn-src-stable-6@FreeBSD.ORG Tue Sep 8 14:19:14 2009 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A018106566B; Tue, 8 Sep 2009 14:19:14 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DBE28FC22; Tue, 8 Sep 2009 14:19:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n88EJEba049983; Tue, 8 Sep 2009 14:19:14 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n88EJE4P049981; Tue, 8 Sep 2009 14:19:14 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200909081419.n88EJE4P049981@svn.freebsd.org> From: Attilio Rao Date: Tue, 8 Sep 2009 14:19:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196973 - stable/6/sys/ufs/ffs X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2009 14:19:14 -0000 Author: attilio Date: Tue Sep 8 14:19:14 2009 New Revision: 196973 URL: http://svn.freebsd.org/changeset/base/196973 Log: MFC r180758: Prevent the bdflush() activity when trying to lock an indirect block buffer setting TDP_INBDFUSH in the appropriate code paths. Sponsored by: Sandvine Incorporated Modified: stable/6/sys/ufs/ffs/ffs_balloc.c Modified: stable/6/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- stable/6/sys/ufs/ffs/ffs_balloc.c Tue Sep 8 14:15:14 2009 (r196972) +++ stable/6/sys/ufs/ffs/ffs_balloc.c Tue Sep 8 14:19:14 2009 (r196973) @@ -104,6 +104,7 @@ ffs_balloc_ufs1(struct vnode *vp, off_t ufs1_daddr_t *allocib, *blkp, *allocblk, allociblk[NIADDR + 1]; ufs2_daddr_t *lbns_remfree, lbns[NIADDR + 1]; int unwindidx = -1; + int saved_inbdflush; ip = VTOI(vp); dp = ip->i_din1; @@ -225,6 +226,9 @@ ffs_balloc_ufs1(struct vnode *vp, off_t if (num < 1) panic ("ffs_balloc_ufs1: ufs_getlbns returned indirect block"); #endif + saved_inbdflush = ~TDP_INBDFLUSH | (curthread->td_pflags & + TDP_INBDFLUSH); + curthread->td_pflags |= TDP_INBDFLUSH; /* * Fetch the first indirect block allocating if necessary. */ @@ -237,8 +241,10 @@ ffs_balloc_ufs1(struct vnode *vp, off_t UFS_LOCK(ump); pref = ffs_blkpref_ufs1(ip, lbn, 0, (ufs1_daddr_t *)0); if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, - cred, &newb)) != 0) + cred, &newb)) != 0) { + curthread->td_pflags &= saved_inbdflush; return (error); + } nb = newb; *allocblk++ = nb; *lbns_remfree++ = indirs[1].in_lbn; @@ -329,6 +335,7 @@ ffs_balloc_ufs1(struct vnode *vp, off_t * If asked only for the indirect block, then return it. */ if (flags & BA_METAONLY) { + curthread->td_pflags &= saved_inbdflush; *bpp = bp; return (0); } @@ -366,6 +373,7 @@ ffs_balloc_ufs1(struct vnode *vp, off_t bp->b_flags |= B_CLUSTEROK; bdwrite(bp); } + curthread->td_pflags &= saved_inbdflush; *bpp = nbp; return (0); } @@ -387,9 +395,11 @@ ffs_balloc_ufs1(struct vnode *vp, off_t nbp = getblk(vp, lbn, fs->fs_bsize, 0, 0, 0); nbp->b_blkno = fsbtodb(fs, nb); } + curthread->td_pflags &= saved_inbdflush; *bpp = nbp; return (0); fail: + curthread->td_pflags &= saved_inbdflush; /* * If we have failed to allocate any blocks, simply return the error. * This is the usual case and avoids the need to fsync the file. @@ -489,6 +499,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t ufs2_daddr_t *lbns_remfree, lbns[NIADDR + 1]; int deallocated, osize, nsize, num, i, error; int unwindidx = -1; + int saved_inbdflush; ip = VTOI(vp); dp = ip->i_din2; @@ -719,6 +730,9 @@ ffs_balloc_ufs2(struct vnode *vp, off_t if (num < 1) panic ("ffs_balloc_ufs2: ufs_getlbns returned indirect block"); #endif + saved_inbdflush = ~TDP_INBDFLUSH | (curthread->td_pflags & + TDP_INBDFLUSH); + curthread->td_pflags |= TDP_INBDFLUSH; /* * Fetch the first indirect block allocating if necessary. */ @@ -731,8 +745,10 @@ ffs_balloc_ufs2(struct vnode *vp, off_t UFS_LOCK(ump); pref = ffs_blkpref_ufs2(ip, lbn, 0, (ufs2_daddr_t *)0); if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, - cred, &newb)) != 0) + cred, &newb)) != 0) { + curthread->td_pflags &= saved_inbdflush; return (error); + } nb = newb; *allocblk++ = nb; *lbns_remfree++ = indirs[1].in_lbn; @@ -823,6 +839,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t * If asked only for the indirect block, then return it. */ if (flags & BA_METAONLY) { + curthread->td_pflags &= saved_inbdflush; *bpp = bp; return (0); } @@ -860,6 +877,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t bp->b_flags |= B_CLUSTEROK; bdwrite(bp); } + curthread->td_pflags &= saved_inbdflush; *bpp = nbp; return (0); } @@ -887,9 +905,11 @@ ffs_balloc_ufs2(struct vnode *vp, off_t nbp = getblk(vp, lbn, fs->fs_bsize, 0, 0, 0); nbp->b_blkno = fsbtodb(fs, nb); } + curthread->td_pflags &= saved_inbdflush; *bpp = nbp; return (0); fail: + curthread->td_pflags &= saved_inbdflush; /* * If we have failed to allocate any blocks, simply return the error. * This is the usual case and avoids the need to fsync the file. From owner-svn-src-stable-6@FreeBSD.ORG Tue Sep 8 15:13:50 2009 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14A621065679; Tue, 8 Sep 2009 15:13:50 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 010728FC19; Tue, 8 Sep 2009 15:13:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n88FDnOk051226; Tue, 8 Sep 2009 15:13:49 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n88FDn06051220; Tue, 8 Sep 2009 15:13:49 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200909081513.n88FDn06051220@svn.freebsd.org> From: Attilio Rao Date: Tue, 8 Sep 2009 15:13:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196975 - in stable/6: bin/ps sys/kern X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Sep 2009 15:13:50 -0000 Author: attilio Date: Tue Sep 8 15:13:49 2009 New Revision: 196975 URL: http://svn.freebsd.org/changeset/base/196975 Log: MFC r189078: * Implement ucomm with a dynamic size function in order to print out the threads name also in the case they are not the last one shown. * On AMD64 pointers don't have enough space to be printed. Fix it. * Check a return value for malloc which wasn't checked before Sponsored by: Sandvine Incorporated Modified: stable/6/bin/ps/extern.h stable/6/bin/ps/keyword.c stable/6/bin/ps/print.c stable/6/bin/ps/ps.c stable/6/sys/kern/kern_proc.c Modified: stable/6/bin/ps/extern.h ============================================================================== --- stable/6/bin/ps/extern.h Tue Sep 8 14:43:42 2009 (r196974) +++ stable/6/bin/ps/extern.h Tue Sep 8 15:13:49 2009 (r196975) @@ -39,7 +39,7 @@ extern fixpt_t ccpu; extern int cflag, eval, fscale, nlistread, rawcpu; extern unsigned long mempages; extern time_t now; -extern int sumrusage, termwidth, totwidth; +extern int showthreads, sumrusage, termwidth, totwidth; extern STAILQ_HEAD(velisthead, varent) varlist; __BEGIN_DECLS @@ -71,6 +71,7 @@ void priorityr(KINFO *, VARENT *); void rgroupname(KINFO *, VARENT *); void runame(KINFO *, VARENT *); void rvar(KINFO *, VARENT *); +int s_comm(KINFO *); int s_label(KINFO *); int s_rgroupname(KINFO *); int s_runame(KINFO *); Modified: stable/6/bin/ps/keyword.c ============================================================================== --- stable/6/bin/ps/keyword.c Tue Sep 8 14:43:42 2009 (r196974) +++ stable/6/bin/ps/keyword.c Tue Sep 8 15:13:49 2009 (r196975) @@ -79,8 +79,8 @@ static VAR var[] = { CHAR, NULL, 0}, {"blocked", "", "sigmask", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, {"caught", "", "sigcatch", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"comm", "COMMAND", NULL, LJUST, ucomm, NULL, MAXCOMLEN, 0, CHAR, - NULL, 0}, + {"comm", "COMMAND", NULL, LJUST|DSIZ, ucomm, s_comm, + COMMLEN + OCOMMLEN + 1, 0, CHAR, NULL, 0}, {"command", "COMMAND", NULL, COMM|LJUST|USER, command, NULL, 16, 0, CHAR, NULL, 0}, {"cpu", "CPU", NULL, 0, kvar, NULL, 3, KOFF(ki_estcpu), UINT, "d", @@ -135,12 +135,13 @@ static VAR var[] = { LONG, "ld", 0}, {"nvcsw", "NVCSW", NULL, USER, rvar, NULL, 5, ROFF(ru_nvcsw), LONG, "ld", 0}, - {"nwchan", "NWCHAN", NULL, LJUST, nwchan, NULL, 8, 0, CHAR, NULL, 0}, + {"nwchan", "NWCHAN", NULL, LJUST, nwchan, NULL, sizeof(void *) * 2, 0, + CHAR, NULL, 0}, {"oublk", "OUBLK", NULL, USER, rvar, NULL, 4, ROFF(ru_oublock), LONG, "ld", 0}, {"oublock", "", "oublk", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, - {"paddr", "PADDR", NULL, 0, kvar, NULL, 8, KOFF(ki_paddr), KPTR, - "lx", 0}, + {"paddr", "PADDR", NULL, 0, kvar, NULL, sizeof(void *) * 2, + KOFF(ki_paddr), KPTR, "lx", 0}, {"pagein", "PAGEIN", NULL, USER, pagein, NULL, 6, 0, CHAR, NULL, 0}, {"pcpu", "", "%cpu", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, {"pending", "", "sig", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, @@ -194,13 +195,13 @@ static VAR var[] = { {"tsiz", "TSIZ", NULL, 0, kvar, NULL, 4, KOFF(ki_tsize), PGTOK, "ld", 0}, {"tt", "TT ", NULL, 0, tname, NULL, 4, 0, CHAR, NULL, 0}, {"tty", "TTY", NULL, LJUST, longtname, NULL, 8, 0, CHAR, NULL, 0}, - {"ucomm", "UCOMM", NULL, LJUST, ucomm, NULL, MAXCOMLEN, 0, CHAR, NULL, - 0}, + {"ucomm", "UCOMM", NULL, LJUST|DSIZ, ucomm, s_comm, + COMMLEN + OCOMMLEN + 1, 0, CHAR, NULL, 0}, {"uid", "UID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_uid), UINT, UIDFMT, 0}, {"upr", "UPR", NULL, 0, upr, NULL, 3, 0, CHAR, NULL, 0}, - {"uprocp", "UPROCP", NULL, 0, kvar, NULL, 8, KOFF(ki_paddr), KPTR, - "lx", 0}, + {"uprocp", "UPROCP", NULL, 0, kvar, NULL, sizeof(void *) * 2, + KOFF(ki_paddr), KPTR, "lx", 0}, {"user", "USER", NULL, LJUST|DSIZ, uname, s_uname, USERLEN, 0, CHAR, NULL, 0}, {"usrpri", "", "upr", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, @@ -324,6 +325,8 @@ findvar(char *p, int user, char **header */ rflen = strlen(v->alias) + strlen(hp) + 2; realfmt = malloc(rflen); + if (realfmt == NULL) + errx(1, "malloc failed"); snprintf(realfmt, rflen, "%s=%s", v->alias, hp); parsefmt(realfmt, user); } Modified: stable/6/bin/ps/print.c ============================================================================== --- stable/6/bin/ps/print.c Tue Sep 8 14:43:42 2009 (r196974) +++ stable/6/bin/ps/print.c Tue Sep 8 15:13:49 2009 (r196975) @@ -175,13 +175,22 @@ command(KINFO *k, VARENT *ve) void ucomm(KINFO *k, VARENT *ve) { + char tmpbuff[COMMLEN + OCOMMLEN + 2]; VAR *v; v = ve->var; if (STAILQ_NEXT(ve, next_ve) == NULL) /* last field, don't pad */ (void)printf("%s", k->ki_p->ki_comm); - else - (void)printf("%-*s", v->width, k->ki_p->ki_comm); + else { + bzero(tmpbuff, sizeof(tmpbuff)); + if (showthreads && k->ki_p->ki_numthreads > 1) + sprintf(tmpbuff, "%s/%s", k->ki_p->ki_comm, + k->ki_p->ki_ocomm); + else + sprintf(tmpbuff, "%s", k->ki_p->ki_comm); + (void)printf("%-*s", v->width, tmpbuff); + } + } void @@ -804,6 +813,20 @@ out: } int +s_comm(KINFO *k) +{ + char tmpbuff[COMMLEN + OCOMMLEN + 2]; + + bzero(tmpbuff, sizeof(tmpbuff)); + if (showthreads && k->ki_p->ki_numthreads > 1) + sprintf(tmpbuff, "%s/%s", k->ki_p->ki_comm, + k->ki_p->ki_ocomm); + else + sprintf(tmpbuff, "%s", k->ki_p->ki_comm); + return (strlen(tmpbuff)); +} + +int s_label(KINFO *k) { char *string = NULL; Modified: stable/6/bin/ps/ps.c ============================================================================== --- stable/6/bin/ps/ps.c Tue Sep 8 14:43:42 2009 (r196974) +++ stable/6/bin/ps/ps.c Tue Sep 8 15:13:49 2009 (r196975) @@ -98,6 +98,7 @@ int rawcpu; /* -C */ int sumrusage; /* -S */ int termwidth; /* Width of the screen (0 == infinity). */ int totwidth; /* Calculated-width of requested variables. */ +int showthreads; /* will threads be shown? */ struct velisthead varlist = STAILQ_HEAD_INITIALIZER(varlist); @@ -175,7 +176,7 @@ main(int argc, char *argv[]) char *cols; int all, ch, elem, flag, _fmt, i, lineno; int nentries, nkept, nselectors; - int prtheader, showthreads, wflag, what, xkeep, xkeep_implied; + int prtheader, wflag, what, xkeep, xkeep_implied; char errbuf[_POSIX2_LINE_MAX]; (void) setlocale(LC_ALL, ""); Modified: stable/6/sys/kern/kern_proc.c ============================================================================== --- stable/6/sys/kern/kern_proc.c Tue Sep 8 14:43:42 2009 (r196974) +++ stable/6/sys/kern/kern_proc.c Tue Sep 8 15:13:49 2009 (r196975) @@ -72,6 +72,7 @@ MALLOC_DEFINE(M_SUBPROC, "subproc", "Pro static void doenterpgrp(struct proc *, struct pgrp *); static void orphanpg(struct pgrp *pg); +static void fill_kinfo_aggregate(struct proc *p, struct kinfo_proc *kp); static void fill_kinfo_proc_only(struct proc *p, struct kinfo_proc *kp); static void fill_kinfo_thread(struct thread *td, struct kinfo_proc *kp); static void pgadjustjobc(struct pgrp *pgrp, int entering); @@ -611,6 +612,26 @@ DB_SHOW_COMMAND(pgrpdump, pgrpdump) #endif /* DDB */ /* + * Rework the kinfo_proc members which need to be aggregated in the + * case of process-ware informations. + * Must be called with sched_lock held. + */ +static void +fill_kinfo_aggregate(struct proc *p, struct kinfo_proc *kp) +{ + struct thread *td; + + mtx_assert(&sched_lock, MA_OWNED); + + kp->ki_estcpu = 0; + kp->ki_pctcpu = 0; + FOREACH_THREAD_IN_PROC(p, td) { + kp->ki_pctcpu += sched_pctcpu(td); + kp->ki_estcpu += td->td_ksegrp->kg_estcpu; + } +} + +/* * Clear kinfo_proc and fill in any information that is common * to all threads in the process. * Must be called with the target process locked. @@ -830,8 +851,9 @@ fill_kinfo_proc(struct proc *p, struct k fill_kinfo_proc_only(p, kp); mtx_lock_spin(&sched_lock); - if (FIRST_THREAD_IN_PROC(p) != NULL) - fill_kinfo_thread(FIRST_THREAD_IN_PROC(p), kp); + MPASS(FIRST_THREAD_IN_PROC(p) != NULL); + fill_kinfo_thread(FIRST_THREAD_IN_PROC(p), kp); + fill_kinfo_aggregate(p, kp); mtx_unlock_spin(&sched_lock); } @@ -897,27 +919,20 @@ sysctl_out_proc(struct proc *p, struct s PROC_LOCK_ASSERT(p, MA_OWNED); - fill_kinfo_proc_only(p, &kinfo_proc); - if (flags & KERN_PROC_NOTHREADS) { - mtx_lock_spin(&sched_lock); - if (FIRST_THREAD_IN_PROC(p) != NULL) - fill_kinfo_thread(FIRST_THREAD_IN_PROC(p), &kinfo_proc); - mtx_unlock_spin(&sched_lock); + fill_kinfo_proc(p, &kinfo_proc); + if (flags & KERN_PROC_NOTHREADS) error = SYSCTL_OUT(req, (caddr_t)&kinfo_proc, - sizeof(kinfo_proc)); - } else { + sizeof(kinfo_proc)); + else { mtx_lock_spin(&sched_lock); - if (FIRST_THREAD_IN_PROC(p) != NULL) - FOREACH_THREAD_IN_PROC(p, td) { - fill_kinfo_thread(td, &kinfo_proc); - error = SYSCTL_OUT(req, (caddr_t)&kinfo_proc, - sizeof(kinfo_proc)); - if (error) - break; - } - else + MPASS(FIRST_THREAD_IN_PROC(p) != NULL); + FOREACH_THREAD_IN_PROC(p, td) { + fill_kinfo_thread(td, &kinfo_proc); error = SYSCTL_OUT(req, (caddr_t)&kinfo_proc, - sizeof(kinfo_proc)); + sizeof(kinfo_proc)); + if (error) + break; + } mtx_unlock_spin(&sched_lock); } PROC_UNLOCK(p); From owner-svn-src-stable-6@FreeBSD.ORG Wed Sep 9 00:16:49 2009 Return-Path: Delivered-To: svn-src-stable-6@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E66C41065693; Wed, 9 Sep 2009 00:16:49 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D548D8FC12; Wed, 9 Sep 2009 00:16:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n890GnZs066191; Wed, 9 Sep 2009 00:16:49 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n890Gnvw066188; Wed, 9 Sep 2009 00:16:49 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200909090016.n890Gnvw066188@svn.freebsd.org> From: Edwin Groothuis Date: Wed, 9 Sep 2009 00:16:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197002 - stable/6/share/zoneinfo X-BeenThere: svn-src-stable-6@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 6-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2009 00:16:50 -0000 Author: edwin Date: Wed Sep 9 00:16:49 2009 New Revision: 197002 URL: http://svn.freebsd.org/changeset/base/197002 Log: MFC from 197000: Update to tzdata2008m: Samoa will go in DST on 4 October 2009 till 28 March 2010 Palestine will go back from DST on 4 September 2009 Modified: stable/6/share/zoneinfo/ (props changed) stable/6/share/zoneinfo/asia stable/6/share/zoneinfo/australasia Modified: stable/6/share/zoneinfo/asia ============================================================================== --- stable/6/share/zoneinfo/asia Wed Sep 9 00:15:43 2009 (r197001) +++ stable/6/share/zoneinfo/asia Wed Sep 9 00:16:49 2009 (r197002) @@ -1,5 +1,5 @@ #
-# @(#)asia	8.36
+# @(#)asia	8.40
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -1836,6 +1836,42 @@ Zone	Asia/Karachi	4:28:12 -	LMT	1907
 # http://www.worldtimezone.com/dst_news/dst_news_westbank01.html
 # 
 
+# From Steffen Thorsen (2009-08-31):
+# Palestine's Council of Ministers announced that they will revert back to
+# winter time on Friday, 2009-09-04.
+#
+# One news source:
+# 
+# http://www.safa.ps/ara/?action=showdetail&seid=4158
+# 
+# (Palestinian press agency, Arabic),
+# Google translate: "Decided that the Palestinian government in Ramallah
+# headed by Salam Fayyad, the start of work in time for the winter of
+# 2009, starting on Friday approved the fourth delay Sept. clock sixty
+# minutes per hour as of Friday morning."
+#
+# We are not sure if Gaza will do the same, last year they had a different
+# end date, we will keep this page updated:
+# 
+# http://www.timeanddate.com/news/time/westbank-gaza-dst-2009.html
+# 
+
+# From Alexander Krivenyshev (2009-09-02):
+# Seems that Gaza Strip will go back to Winter Time same date as West Bank.
+#
+# According to Palestinian Ministry Of Interior, West Bank and Gaza Strip plan
+# to change time back to Standard time on September 4, 2009.
+#
+# "Winter time unite the West Bank and Gaza"
+# (from Palestinian National Authority):
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_gazastrip02.html
+# 
+
 # The rules for Egypt are stolen from the `africa' file.
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule EgyptAsia	1957	only	-	May	10	0:00	1:00	S
@@ -1854,7 +1890,7 @@ Rule Palestine	2006	only	-	Sep	22	0:00	0
 Rule Palestine	2007	only	-	Sep	Thu>=8	2:00	0	-
 Rule Palestine	2008	only	-	Aug	lastFri	2:00	0	-
 Rule Palestine	2009	max	-	Mar	lastFri	0:00	1:00	S
-Rule Palestine	2009	max	-	Sep	lastMon	2:00	0	-
+Rule Palestine	2009	max	-	Sep	Fri>=1	2:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Gaza	2:17:52	-	LMT	1900 Oct

Modified: stable/6/share/zoneinfo/australasia
==============================================================================
--- stable/6/share/zoneinfo/australasia	Wed Sep  9 00:15:43 2009	(r197001)
+++ stable/6/share/zoneinfo/australasia	Wed Sep  9 00:16:49 2009	(r197002)
@@ -1,5 +1,5 @@
 # 
-# @(#)australasia	8.12
+# @(#)australasia	8.13
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -443,10 +443,26 @@ Zone Pacific/Pago_Pago	 12:37:12 -	LMT	1
 # http://www.worldtimezone.com/dst_news/dst_news_samoa01.html
 # 
 
+# From Steffen Thorsen (2009-08-27):
+# Samoa's parliament passed the Daylight Saving Bill 2009, and will start 
+# daylight saving time on the first Sunday of October 2009 and end on the 
+# last Sunday of March 2010. We hope that the full text will be published 
+# soon, but we believe that the bill is only valid for 2009-2010. Samoa's 
+# Daylight Saving Act 2009 will be enforced as soon as the Head of State 
+# executes a proclamation publicizing this Act.
+#
+# Some background information here, which will be updated once we have 
+# more details:
+# 
+# http://www.timeanddate.com/news/time/samoa-dst-plan-2009.html
+# 
+
 Zone Pacific/Apia	 12:33:04 -	LMT	1879 Jul  5
 			-11:26:56 -	LMT	1911
 			-11:30	-	SAMT	1950		# Samoa Time
-			-11:00	-	WST			# Samoa Time
+			-11:00	-	WST	2009 Oct 4
+			-11:00	1:00	WSDT	2010 Mar 28
+			-11:00	-	WST
 
 # Solomon Is
 # excludes Bougainville, for which see Papua New Guinea

From owner-svn-src-stable-6@FreeBSD.ORG  Thu Sep 10 12:55:09 2009
Return-Path: 
Delivered-To: svn-src-stable-6@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5BF69106566C;
	Thu, 10 Sep 2009 12:55:09 +0000 (UTC)
	(envelope-from attilio@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4A6958FC19;
	Thu, 10 Sep 2009 12:55:09 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8ACt9mu020014;
	Thu, 10 Sep 2009 12:55:09 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8ACt9EO020011;
	Thu, 10 Sep 2009 12:55:09 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <200909101255.n8ACt9EO020011@svn.freebsd.org>
From: Attilio Rao 
Date: Thu, 10 Sep 2009 12:55:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
X-SVN-Group: stable-6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r197061 - stable/6/contrib/gdtoa
X-BeenThere: svn-src-stable-6@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 6-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 10 Sep 2009 12:55:09 -0000

Author: attilio
Date: Thu Sep 10 12:55:09 2009
New Revision: 197061
URL: http://svn.freebsd.org/changeset/base/197061

Log:
  MFC r196916:
  Fix a list overrun.
  
  Sponsored by: Sandvine Incorporated

Modified:
  stable/6/contrib/gdtoa/gdtoaimp.h
  stable/6/contrib/gdtoa/misc.c

Modified: stable/6/contrib/gdtoa/gdtoaimp.h
==============================================================================
--- stable/6/contrib/gdtoa/gdtoaimp.h	Thu Sep 10 12:42:36 2009	(r197060)
+++ stable/6/contrib/gdtoa/gdtoaimp.h	Thu Sep 10 12:55:09 2009	(r197061)
@@ -479,7 +479,7 @@ extern pthread_mutex_t __gdtoa_locks[2];
 		_pthread_mutex_unlock(&__gdtoa_locks[n]);	\
 } while(0)
 
-#define Kmax 15
+#define Kmax 9
 
  struct
 Bigint {

Modified: stable/6/contrib/gdtoa/misc.c
==============================================================================
--- stable/6/contrib/gdtoa/misc.c	Thu Sep 10 12:42:36 2009	(r197060)
+++ stable/6/contrib/gdtoa/misc.c	Thu Sep 10 12:55:09 2009	(r197061)
@@ -61,7 +61,9 @@ Balloc
 #endif
 
 	ACQUIRE_DTOA_LOCK(0);
-	if ( (rv = freelist[k]) !=0) {
+	/* The k > Kmax case does not need ACQUIRE_DTOA_LOCK(0), */
+	/* but this case seems very unlikely. */
+	if (k <= Kmax && (rv = freelist[k]) !=0) {
 		freelist[k] = rv->next;
 		}
 	else {
@@ -71,7 +73,7 @@ Balloc
 #else
 		len = (sizeof(Bigint) + (x-1)*sizeof(ULong) + sizeof(double) - 1)
 			/sizeof(double);
-		if (pmem_next - private_mem + len <= PRIVATE_mem) {
+		if (k <= Kmax && pmem_next - private_mem + len <= PRIVATE_mem) {
 			rv = (Bigint*)pmem_next;
 			pmem_next += len;
 			}
@@ -95,10 +97,14 @@ Bfree
 #endif
 {
 	if (v) {
-		ACQUIRE_DTOA_LOCK(0);
-		v->next = freelist[v->k];
-		freelist[v->k] = v;
-		FREE_DTOA_LOCK(0);
+		if (v->k > Kmax)
+			free((void*)v);
+		else {
+			ACQUIRE_DTOA_LOCK(0);
+			v->next = freelist[v->k];
+			freelist[v->k] = v;
+			FREE_DTOA_LOCK(0);
+			}
 		}
 	}