svn commit: r254132 - head/etc/namedb

2013-08-09 Thread Erwin Lansing
Author: erwin
Date: Fri Aug  9 07:57:04 2013
New Revision: 254132
URL: http://svnweb.freebsd.org/changeset/base/254132

Log:
  Add empty zones for Shared Address Space (RFC 6598)
  
  Approved by:  delphij (mentor)
  MFC after:3 days
  Sponsored by: DK Hostmaster A/S

Modified:
  head/etc/namedb/named.conf

Modified: head/etc/namedb/named.conf
==
--- head/etc/namedb/named.conf  Fri Aug  9 06:54:52 2013(r254131)
+++ head/etc/namedb/named.conf  Fri Aug  9 07:57:04 2013(r254132)
@@ -153,6 +153,72 @@ zone "30.172.in-addr.arpa" { type master
 zone "31.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
 zone "168.192.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
 
+// Shared Address Space (RFC 6598)
+zone "64.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "65.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "66.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "67.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "68.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "69.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "70.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "71.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "72.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "73.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "74.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "75.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "76.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "77.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "78.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "79.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "80.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "81.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "82.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "83.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "84.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "85.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "86.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "87.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "88.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "89.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "90.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "91.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "92.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "93.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "94.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "95.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "96.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "97.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "98.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "99.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "100.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "101.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "102.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "103.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "104.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "105.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "106.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "107.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "108.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "109.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "110.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "111.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "112.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; 
};
+zone "113.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.

svn commit: r254133 - in head/sys: amd64/conf i386/conf ia64/conf powerpc/conf sparc64/conf

2013-08-09 Thread Andriy Gapon
Author: avg
Date: Fri Aug  9 08:11:09 2013
New Revision: 254133
URL: http://svnweb.freebsd.org/changeset/base/254133

Log:
  follow up to r254051
  
  - update powerpc/GENERIC64 as well, suggested by mdf
  - update comments so that they make sense after the change, suggested by
jhb
  
  X-MFC after:  never (change specific to head)

Modified:
  head/sys/amd64/conf/GENERIC
  head/sys/i386/conf/GENERIC
  head/sys/ia64/conf/GENERIC
  head/sys/powerpc/conf/GENERIC
  head/sys/powerpc/conf/GENERIC64
  head/sys/sparc64/conf/GENERIC

Modified: head/sys/amd64/conf/GENERIC
==
--- head/sys/amd64/conf/GENERIC Fri Aug  9 07:57:04 2013(r254132)
+++ head/sys/amd64/conf/GENERIC Fri Aug  9 08:11:09 2013(r254133)
@@ -74,9 +74,8 @@ options   INCLUDE_CONFIG_FILE # Inclu
 
 # Debugging support.  Always need this:
 optionsKDB # Enable kernel debugger support.
-# For minimum debugger support (stable branch) use:
 optionsKDB_TRACE   # Print a stack trace for a panic.
-# For full debugger support use this instead:
+# For full debugger support use (turn off in stable branch):
 optionsDDB # Support DDB.
 optionsGDB # Support remote GDB.
 optionsDEADLKRES   # Enable the deadlock resolver

Modified: head/sys/i386/conf/GENERIC
==
--- head/sys/i386/conf/GENERIC  Fri Aug  9 07:57:04 2013(r254132)
+++ head/sys/i386/conf/GENERIC  Fri Aug  9 08:11:09 2013(r254133)
@@ -74,9 +74,8 @@ options   INCLUDE_CONFIG_FILE # Inclu
 
 # Debugging support.  Always need this:
 optionsKDB # Enable kernel debugger support.
-# For minimum debugger support (stable branch) use:
 optionsKDB_TRACE   # Print a stack trace for a panic.
-# For full debugger support use this instead:
+# For full debugger support use (turn off in stable branch):
 optionsDDB # Support DDB.
 optionsGDB # Support remote GDB.
 optionsDEADLKRES   # Enable the deadlock resolver

Modified: head/sys/ia64/conf/GENERIC
==
--- head/sys/ia64/conf/GENERIC  Fri Aug  9 07:57:04 2013(r254132)
+++ head/sys/ia64/conf/GENERIC  Fri Aug  9 08:11:09 2013(r254133)
@@ -65,9 +65,8 @@ options   _KPOSIX_PRIORITY_SCHEDULING # P
 
 # Debugging support.  Always need this:
 optionsKDB # Enable kernel debugger support.
-# For minimum debugger support (stable branch) use:
 optionsKDB_TRACE   # Print a stack trace for a panic.
-# For full debugger support use this instead:
+# For full debugger support use (turn off in stable branch):
 optionsDDB # Support DDB
 optionsGDB # Support remote GDB
 optionsDEADLKRES   # Enable the deadlock resolver

Modified: head/sys/powerpc/conf/GENERIC
==
--- head/sys/powerpc/conf/GENERIC   Fri Aug  9 07:57:04 2013
(r254132)
+++ head/sys/powerpc/conf/GENERIC   Fri Aug  9 08:11:09 2013
(r254133)
@@ -76,9 +76,8 @@ options   INCLUDE_CONFIG_FILE # Inclu
 
 # Debugging support.  Always need this:
 optionsKDB # Enable kernel debugger support.
-# For minimum debugger support (stable branch) use:
 optionsKDB_TRACE   # Print a stack trace for a panic.
-# For full debugger support use this instead:
+# For full debugger support use (turn off in stable branch):
 optionsDDB #Support DDB
 #options   DEADLKRES   #Enable the deadlock resolver
 optionsINVARIANTS  #Enable calls of extra sanity checking

Modified: head/sys/powerpc/conf/GENERIC64
==
--- head/sys/powerpc/conf/GENERIC64 Fri Aug  9 07:57:04 2013
(r254132)
+++ head/sys/powerpc/conf/GENERIC64 Fri Aug  9 08:11:09 2013
(r254133)
@@ -71,9 +71,8 @@ options   INCLUDE_CONFIG_FILE # Inclu
 
 # Debugging support.  Always need this:
 optionsKDB # Enable kernel debugger support.
-# For minimum debugger support (stable branch) use:
-#options   KDB_TRACE   # Print a stack trace for a panic.
-# For full debugger support use this instead:
+optionsKDB_TRACE   # Print a stack trace for a panic.
+# For full debugger support use (turn off in stable branch):
 optionsDDB #Support DDB
 #options   DEADLKRES   #Enable the deadlock resolver
 optionsINVARIANTS  #Enable calls of extra sanity checking

Re: svn commit: r254025 - in head/sys: amd64/amd64 arm/arm arm/at91 arm/mv/armadaxp arm/s3c2xx0 arm/xscale/i80321 arm/xscale/i8134x arm/xscale/ixp425 cddl/compat/opensolaris/kern cddl/compat/opensolar

2013-08-09 Thread Zbigniew Bodek
2013/8/8 Zbyszek Bodek 

> On 07.08.2013 20:55, Jeff Roberson wrote:
> > On Wed, 7 Aug 2013, Zbyszek Bodek wrote:
> >
> >> On 07.08.2013 08:21, Jeff Roberson wrote:
> >>> Author: jeff
> >>> Date: Wed Aug  7 06:21:20 2013
> >>> New Revision: 254025
> >>> URL: http://svnweb.freebsd.org/changeset/base/254025
> >>>
> >>> Log:
> >>>   Replace kernel virtual address space allocation with vmem.  This
> >>> provides
> >>>   transparent layering and better fragmentation.
> >>>
> >>>- Normalize functions that allocate memory to use kmem_*
> >>>- Those that allocate address space are named kva_*
> >>>- Those that operate on maps are named kmap_*
> >>>- Implement recursive allocation handling for kmem_arena in vmem.
> >>>
> >>>   Reviewed by:alc
> >>>   Tested by:pho
> >>>   Sponsored by:EMC / Isilon Storage Division
> >>>
> >>
> >> Hello Jeff,
> >>
> >> I'm having some trouble on my ARM platform staring from this commit.
> >> Kernel panics on assertion very early. Please check out log below (as
> >> you can see bt doesn't look helpful but assertion message is visible. I
> >> can send you which functions are in bt if it is necessary).
> >
> > It would be very helpful to know which function is passing the unaligned
> > value.  I will resolve this later today if you can get me that
> information.
> >
> > Thanks,
> > Jeff
> >
>
> Hello Jeff,
>
> I'm attaching the BT with functions names included.
> Please give me a notice when you need something more.
>
> Hello again.

It seems that despite the attachment is visible in my sent messages it was
not included to the message on the mailing lists.
Hence I'm pasting it to this e-mail. Sorry for the possible inconvenience.

Best regards
Zbyszek Bodek

---
WARNING: DIAGNOSTIC option enabled, expect reduced performance.
panic: Assertion (size & vm->vm_quantum_mask) == 0 failed at
/home/zbb/projects/armsp/freebsd-arm-superpages/sys/kern/subr_vmem.c:341
cpuid = 0
KDB: stack backtrace:
db_trace_self() at 0xc11fb224
 pc = 0xc11fb224  lr = 0xc0f2dd34 (0xc0f2dd34)
 sp = 0xc1372c90  fp = 0xc1347fc8
db_trace_self_wrapper() at 0xc0f2dd34
 pc = 0xc0f2dd34  lr = 0xc1090d84 (0xc1090d84)
 sp = 0xc1372da8  fp = 0xc1347fc8
 r4 = 0xc13452d8
kdb_backtrace() at 0xc1090d84
 pc = 0xc1090d84  lr = 0xc105b300 (0xc105b300)
 sp = 0xc1372db0  fp = 0xc1347fc8
 r4 = 0x0001
vpanic() at 0xc105b300
 pc = 0xc105b300  lr = 0xc105b3f4 (0xc105b3f4)
 sp = 0xc1372dd0  fp = 0xc1347fc8
 r4 = 0xc1252570  r5 = 0x1333
 r6 = 0xc1347f80  r7 = 0xc1494150
 r8 = 0x0010 r10 = 0xc1348140
kassert_panic() at 0xc105b3f4
 pc = 0xc105b3f4  lr = 0xc10a6b24 (0xc10a6b24)
 sp = 0xc1372e08  fp = 0xc1347fc8
 r0 = 0xc1252570  r1 = 0xc126c6d4
 r2 = 0xc126c64c  r3 = 0x0155
 r4 = 0x0001
bt_insfree() at 0xc10a6b24
 pc = 0xc10a6b24  lr = 0xc10a7410 (0xc10a7410)
 sp = 0xc1372e20  fp = 0xc1347fc8
 r4 = 0xc1494150  r5 = 0xc149416c
 r6 = 0xc1347f80  r7 = 0x1333
 r8 = 0xc57c8000
vmem_add1() at 0xc10a7410
 pc = 0xc10a7410  lr = 0xc10a7604 (0xc10a7604)
 sp = 0xc1372e38  fp = 0xc1347fc8
 r4 = 0xc1347f80  r5 = 0x
 r6 = 0xc57c8000  r7 = 0x1333
 r8 = 0x0010
vmem_add() at 0xc10a7604
 pc = 0xc10a7604  lr = 0xc10a8bb8 (0xc10a8bb8)
 sp = 0xc1372e50  fp = 0xc1347fc8
 r4 = 0xc1347fe4  r5 = 0x
 r6 = 0x0001  r7 = 0xc1347f80
vmem_init() at 0xc10a8bb8
 pc = 0xc10a8bb8  lr = 0xc104487c (0xc104487c)
 sp = 0xc1372e98  fp = 0x
 r4 = 0x1333  r5 = 0xc1347f80
 r6 = 0xc130e588  r7 = 0x00f0004c
 r8 = 0x7f9ea674  r9 = 0x0001
r10 = 0x7ff1449c
kmeminit() at 0xc104487c
 pc = 0xc104487c  lr = 0xc10448ec (0xc10448ec)
 sp = 0xc1372eb8  fp = 0x
 r4 = 0xc1297b90  r5 = 0x00f00058
 r6 = 0x00f0
mallocinit() at 0xc10448ec
 pc = 0xc10448ec  lr = 0xc1010b20 (0xc1010b20)
 sp = 0xc1372ee8  fp = 0x
 r4 = 0xc1297b90  r5 = 0x00f00058
 r6 = 0x00f0  r7 = 0x00f0004c
 r8 = 0x7f9ea674  r9 = 0x0001
r10 = 0x7ff1449c
mi_startup() at 0xc1010b20
 pc = 0xc1010b20  lr = 0xc0f00128 (0xc0f00128)
 sp = 0xc1372ef8  fp = 0x
 r4 = 0x00f00184  r5 = 0x00f00058
virt_done() at 0xc0f00128
 pc = 0xc0f00128  lr = 0xc0f00128 (0xc0f00128)
 sp = 0xc1372ef8  fp = 0x
Unable to unwind further
KDB: enter: panic
[ thread pid 0 tid 0 ]
Stopped at  0xc1090c18: ldrbr15, [r15, r15, ror r15]!
db>
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r254134 - head/bin/pkill

2013-08-09 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Aug  9 08:38:51 2013
New Revision: 254134
URL: http://svnweb.freebsd.org/changeset/base/254134

Log:
  Add -c flag to pgrep(1) and pkill(1), to match login classes.
  
  MFC after:1 month

Modified:
  head/bin/pkill/pkill.1
  head/bin/pkill/pkill.c

Modified: head/bin/pkill/pkill.1
==
--- head/bin/pkill/pkill.1  Fri Aug  9 08:11:09 2013(r254133)
+++ head/bin/pkill/pkill.1  Fri Aug  9 08:38:51 2013(r254134)
@@ -29,7 +29,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd February 11, 2010
+.Dd August 9, 2013
 .Dt PKILL 1
 .Os
 .Sh NAME
@@ -44,6 +44,7 @@
 .Op Fl N Ar system
 .Op Fl P Ar ppid
 .Op Fl U Ar uid
+.Op Fl c Ar class
 .Op Fl d Ar delim
 .Op Fl g Ar pgrp
 .Op Fl j Ar jid
@@ -60,6 +61,7 @@
 .Op Fl N Ar system
 .Op Fl P Ar ppid
 .Op Fl U Ar uid
+.Op Fl c Ar class
 .Op Fl g Ar pgrp
 .Op Fl j Ar jid
 .Op Fl s Ar sid
@@ -130,6 +132,9 @@ or
 process and all of its ancestors are excluded (unless
 .Fl v
 is used).
+.It Fl c Ar class
+Restrict matches to processes running with specified login class
+.Ar class .
 .It Fl f
 Match against full argument lists.
 The default is to match against process names.

Modified: head/bin/pkill/pkill.c
==
--- head/bin/pkill/pkill.c  Fri Aug  9 08:11:09 2013(r254133)
+++ head/bin/pkill/pkill.c  Fri Aug  9 08:38:51 2013(r254134)
@@ -79,12 +79,14 @@ enum listtype {
LT_TTY,
LT_PGRP,
LT_JID,
-   LT_SID
+   LT_SID,
+   LT_CLASS
 };
 
 struct list {
SLIST_ENTRY(list) li_chain;
longli_number;
+   char*li_name;
 };
 
 SLIST_HEAD(listhead, list);
@@ -116,6 +118,7 @@ static struct listhead ppidlist = SLIST_
 static struct listhead tdevlist = SLIST_HEAD_INITIALIZER(tdevlist);
 static struct listhead sidlist = SLIST_HEAD_INITIALIZER(sidlist);
 static struct listhead jidlist = SLIST_HEAD_INITIALIZER(jidlist);
+static struct listhead classlist = SLIST_HEAD_INITIALIZER(classlist);
 
 static voidusage(void) __attribute__((__noreturn__));
 static int killact(const struct kinfo_proc *);
@@ -179,7 +182,7 @@ main(int argc, char **argv)
execf = NULL;
coref = _PATH_DEVNULL;
 
-   while ((ch = getopt(argc, argv, 
"DF:G:ILM:N:P:SU:ad:fg:ij:lnoqs:t:u:vx")) != -1)
+   while ((ch = getopt(argc, argv, 
"DF:G:ILM:N:P:SU:ac:d:fg:ij:lnoqs:t:u:vx")) != -1)
switch (ch) {
case 'D':
debug_opt++;
@@ -222,6 +225,10 @@ main(int argc, char **argv)
case 'a':
ancestors++;
break;
+   case 'c':
+   makelist(&classlist, LT_CLASS, optarg);
+   criteria = 1;
+   break;
case 'd':
if (!pgrep)
usage();
@@ -469,6 +476,20 @@ main(int argc, char **argv)
continue;
}
 
+   SLIST_FOREACH(li, &classlist, li_chain) {
+   /*
+* We skip P_SYSTEM processes to match ps(1) output.
+*/
+   if ((kp->ki_flag & P_SYSTEM) == 0 &&
+   kp->ki_loginclass != NULL &&
+   strcmp(kp->ki_loginclass, li->li_name) == 0)
+   break;
+   }
+   if (SLIST_FIRST(&classlist) != NULL && li == NULL) {
+   selected[i] = 0;
+   continue;
+   }
+
if (argc == 0)
selected[i] = 1;
}
@@ -562,9 +583,9 @@ usage(void)
 
fprintf(stderr,
"usage: %s %s [-F pidfile] [-G gid] [-M core] [-N system]\n"
-   " [-P ppid] [-U uid] [-g pgrp] [-j jid] [-s sid]\n"
-   " [-t tty] [-u euid] pattern ...\n", getprogname(),
-   ustr);
+   " [-P ppid] [-U uid] [-c class] [-g pgrp] [-j 
jid]\n"
+   " [-s sid] [-t tty] [-u euid] pattern ...\n",
+   getprogname(), ustr);
 
exit(STATUS_BADUSAGE);
 }
@@ -664,8 +685,10 @@ makelist(struct listhead *head, enum lis
SLIST_INSERT_HEAD(head, li, li_chain);
empty = 0;
 
-   li->li_number = (uid_t)strtol(sp, &ep, 0);
-   if (*ep == '\0') {
+   if (type != LT_CLASS)
+   li->li_number = (uid_t)strtol(sp, &ep, 0);
+
+   if (type != LT_CLASS && *ep == '\0') {
switch (type) {
case LT_PGRP:
if (li->li_number == 0)
@@ -750,6 +773,12 @@ foundtty:

svn commit: r254135 - head/sys/kern

2013-08-09 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Aug  9 08:40:31 2013
New Revision: 254135
URL: http://svnweb.freebsd.org/changeset/base/254135

Log:
  Don't dereference null pointer should acl_alloc() be passed M_NOWAIT
  and allocation failed.  Nothing in the tree passed M_NOWAIT.
  
  Obtained from:mjg
  MFC after:1 month

Modified:
  head/sys/kern/vfs_acl.c

Modified: head/sys/kern/vfs_acl.c
==
--- head/sys/kern/vfs_acl.c Fri Aug  9 08:38:51 2013(r254134)
+++ head/sys/kern/vfs_acl.c Fri Aug  9 08:40:31 2013(r254135)
@@ -540,6 +540,9 @@ acl_alloc(int flags)
struct acl *aclp;
 
aclp = malloc(sizeof(*aclp), M_ACL, flags);
+   if (aclp == NULL)
+   return (NULL);
+
aclp->acl_maxcnt = ACL_MAX_ENTRIES;
 
return (aclp);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r254136 - stable/9/contrib/libcxxrt

2013-08-09 Thread David Chisnall
Author: theraven
Date: Fri Aug  9 09:34:11 2013
New Revision: 254136
URL: http://svnweb.freebsd.org/changeset/base/254136

Log:
  MFC alignment fix for libcxxrt.

Modified:
  stable/9/contrib/libcxxrt/unwind-itanium.h
Directory Properties:
  stable/9/contrib/libcxxrt/   (props changed)

Modified: stable/9/contrib/libcxxrt/unwind-itanium.h
==
--- stable/9/contrib/libcxxrt/unwind-itanium.h  Fri Aug  9 08:40:31 2013
(r254135)
+++ stable/9/contrib/libcxxrt/unwind-itanium.h  Fri Aug  9 09:34:11 2013
(r254136)
@@ -80,7 +80,7 @@ struct _Unwind_Exception
 _Unwind_Exception_Cleanup_Fn exception_cleanup;
 unsigned long private_1;
 unsigned long private_2;
-  } __attribute__((__aligned__));
+  };
 
 extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *);
 extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r254138 - in head: share/man/man9 sys/amd64/amd64 sys/arm/arm sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/dev/agp sys/dev/drm2/i915 sys/dev/drm2/ttm sys/dev/md sys/fs/fuse sys/fs...

2013-08-09 Thread Attilio Rao
Author: attilio
Date: Fri Aug  9 11:11:11 2013
New Revision: 254138
URL: http://svnweb.freebsd.org/changeset/base/254138

Log:
  The soft and hard busy mechanism rely on the vm object lock to work.
  Unify the 2 concept into a real, minimal, sxlock where the shared
  acquisition represent the soft busy and the exclusive acquisition
  represent the hard busy.
  The old VPO_WANTED mechanism becames the hard-path for this new lock
  and it becomes per-page rather than per-object.
  The vm_object lock becames an interlock for this functionality:
  it can be held in both read or write mode.
  However, if the vm_object lock is held in read mode while acquiring
  or releasing the busy state, the thread owner cannot make any
  assumption on the busy state unless it is also busying it.
  
  Also:
  - Add a new flag to directly shared busy pages while vm_page_alloc
and vm_page_grab are being executed.  This will be very helpful
once these functions happen under a read object lock.
  - Move the swapping sleep into its own per-object flag
  
  The KPI is heavilly changed this is why the version is bumped.
  It is very likely that some VM ports users will need to change
  their own code.
  
  Sponsored by: EMC / Isilon storage division
  Discussed with:   alc
  Reviewed by:  jeff, kib
  Tested by:gavin, bapt (older version)
  Tested by:pho, scottl

Added:
  head/share/man/man9/vm_page_busy.9   (contents, props changed)
Deleted:
  head/share/man/man9/vm_page_io.9
  head/share/man/man9/vm_page_sleep_if_busy.9
  head/share/man/man9/vm_page_wakeup.9
Modified:
  head/share/man/man9/Makefile
  head/share/man/man9/VOP_GETPAGES.9
  head/share/man/man9/vm_page_alloc.9
  head/sys/amd64/amd64/pmap.c
  head/sys/arm/arm/pmap-v6.c
  head/sys/arm/arm/pmap.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
  head/sys/dev/agp/agp.c
  head/sys/dev/drm2/i915/i915_gem.c
  head/sys/dev/drm2/ttm/ttm_bo_vm.c
  head/sys/dev/drm2/ttm/ttm_tt.c
  head/sys/dev/md/md.c
  head/sys/fs/fuse/fuse_vnops.c
  head/sys/fs/tmpfs/tmpfs_subr.c
  head/sys/fs/tmpfs/tmpfs_vnops.c
  head/sys/i386/i386/pmap.c
  head/sys/i386/xen/pmap.c
  head/sys/ia64/ia64/pmap.c
  head/sys/kern/kern_exec.c
  head/sys/kern/subr_uio.c
  head/sys/kern/uipc_shm.c
  head/sys/kern/uipc_syscalls.c
  head/sys/kern/vfs_bio.c
  head/sys/kern/vfs_cluster.c
  head/sys/mips/mips/pmap.c
  head/sys/powerpc/aim/mmu_oea.c
  head/sys/powerpc/aim/mmu_oea64.c
  head/sys/powerpc/booke/pmap.c
  head/sys/sparc64/sparc64/pmap.c
  head/sys/sys/param.h
  head/sys/vm/phys_pager.c
  head/sys/vm/swap_pager.c
  head/sys/vm/vm_fault.c
  head/sys/vm/vm_glue.c
  head/sys/vm/vm_object.c
  head/sys/vm/vm_page.c
  head/sys/vm/vm_page.h
  head/sys/vm/vm_pageout.c
  head/sys/vm/vm_phys.c
  head/sys/vm/vnode_pager.c

Modified: head/share/man/man9/Makefile
==
--- head/share/man/man9/MakefileFri Aug  9 09:48:05 2013
(r254137)
+++ head/share/man/man9/MakefileFri Aug  9 11:11:11 2013
(r254138)
@@ -332,11 +332,8 @@ MAN=   accept_filter.9 \
vm_page_grab.9 \
vm_page_hold.9 \
vm_page_insert.9 \
-   vm_page_io.9 \
vm_page_lookup.9 \
vm_page_rename.9 \
-   vm_page_sleep_if_busy.9 \
-   vm_page_wakeup.9 \
vm_page_wire.9 \
vm_set_page_size.9 \
vmem.9 \
@@ -1465,6 +1462,21 @@ MLINKS+=vm_page_bits.9 vm_page_clear_dir
vm_page_bits.9 vm_page_test_dirty.9 \
vm_page_bits.9 vm_page_undirty.9 \
vm_page_bits.9 vm_page_zero_invalid.9
+MLINKS+=vm_page_busy.9 vm_page_busied.9 \
+   vm_page_busy.9 vm_page_busy_downgrade.9 \
+   vm_page_busy.9 vm_page_busy_sleep.9 \
+   vm_page_busy.9 vm_page_sbusied.9 \
+   vm_page_busy.9 vm_page_sbusy.9 \
+   vm_page_busy.9 vm_page_sleep_if_busy.9 \
+   vm_page_busy.9 vm_page_sunbusy.9 \
+   vm_page_busy.9 vm_page_trysbusy.9 \
+   vm_page_busy.9 vm_page_tryxbusy.9 \
+   vm_page_busy.9 vm_page_xbusied.9 \
+   vm_page_busy.9 vm_page_xbusy.9 \
+   vm_page_busy.9 vm_page_xunbusy.9 \
+   vm_page_busy.9 vm_page_assert_sbusied.9 \
+   vm_page_busy.9 vm_page_assert_unbusied.9 \
+   vm_page_busy.9 vm_page_assert_xbusied.9
 MLINKS+=vm_page_aflag.9 vm_page_aflag_clear.9 \
vm_page_aflag.9 vm_page_aflag_set.9 \
vm_page_aflag.9 vm_page_reference.9
@@ -1473,10 +1485,6 @@ MLINKS+=vm_page_free.9 vm_page_free_toq.
vm_page_free.9 vm_page_try_to_free.9
 MLINKS+=vm_page_hold.9 vm_page_unhold.9
 MLINKS+=vm_page_insert.9 vm_page_remove.9
-MLINKS+=vm_page_io.9 vm_page_io_finish.9 \
-   vm_page_io.9 vm_page_io_start.9
-MLINKS+=vm_page_wakeup.9 vm_page_busy.9 \
-   vm_page_wakeup.9 vm_page_flash.9
 MLINKS+=vm_page_wire.9 vm_page_unwire.9
 MLINKS+=VOP_ACCESS.9 VOP_ACCESSX.9
 MLINKS+=VOP_ATTRIB.9 VOP_GETATTR.9 \

Modified: head/share/man/man9/VOP_GETPAGES.9
===

svn commit: r254139 - in head: share/man/man9 sys/kern

2013-08-09 Thread Attilio Rao
Author: attilio
Date: Fri Aug  9 11:24:29 2013
New Revision: 254139
URL: http://svnweb.freebsd.org/changeset/base/254139

Log:
  Give mutex(9) the ability to recurse on a per-instance basis.
  Now the MTX_RECURSE flag can be passed to the mtx_*_flag() calls.
  This helps in cases we want to narrow down to specific calls the
  possibility to recurse for some locks.
  
  Sponsored by: EMC / Isilon storage division
  Reviewed by:  jeff, alc
  Tested by:pho

Modified:
  head/share/man/man9/mutex.9
  head/sys/kern/kern_mutex.c

Modified: head/share/man/man9/mutex.9
==
--- head/share/man/man9/mutex.9 Fri Aug  9 11:11:11 2013(r254138)
+++ head/share/man/man9/mutex.9 Fri Aug  9 11:24:29 2013(r254139)
@@ -225,8 +225,10 @@ or
 lock, respectively, and also accept a
 .Fa flags
 argument.
-In both cases, the only flag presently available for lock acquires is
-.Dv MTX_QUIET .
+In both cases, the only flags presently available for lock acquires are
+.Dv MTX_QUIET 
+and
+.Dv MTX_RECURSE .
 If the
 .Dv MTX_QUIET
 bit is turned on in the
@@ -235,6 +237,12 @@ argument, then if
 .Dv KTR_LOCK
 tracing is being done,
 it will be silenced during the lock acquire.
+If the
+.Dv MTX_RECURSE
+bit is turned on in the
+.Fa flags
+argument, then the mutex can be acquired recursively.
+.Pp
 .Pp
 The
 .Fn mtx_trylock

Modified: head/sys/kern/kern_mutex.c
==
--- head/sys/kern/kern_mutex.c  Fri Aug  9 11:11:11 2013(r254138)
+++ head/sys/kern/kern_mutex.c  Fri Aug  9 11:24:29 2013(r254139)
@@ -218,13 +218,14 @@ __mtx_lock_flags(volatile uintptr_t *c, 
KASSERT(LOCK_CLASS(&m->lock_object) == &lock_class_mtx_sleep,
("mtx_lock() of spin mutex %s @ %s:%d", m->lock_object.lo_name,
file, line));
-   WITNESS_CHECKORDER(&m->lock_object, opts | LOP_NEWORDER | LOP_EXCLUSIVE,
-   file, line, NULL);
+   WITNESS_CHECKORDER(&m->lock_object, (opts & ~MTX_RECURSE) |
+   LOP_NEWORDER | LOP_EXCLUSIVE, file, line, NULL);
 
__mtx_lock(m, curthread, opts, file, line);
LOCK_LOG_LOCK("LOCK", &m->lock_object, opts, m->mtx_recurse, file,
line);
-   WITNESS_LOCK(&m->lock_object, opts | LOP_EXCLUSIVE, file, line);
+   WITNESS_LOCK(&m->lock_object, (opts & ~MTX_RECURSE) | LOP_EXCLUSIVE,
+   file, line);
curthread->td_locks++;
 }
 
@@ -271,9 +272,11 @@ __mtx_lock_spin_flags(volatile uintptr_t
("mtx_lock_spin() of sleep mutex %s @ %s:%d",
m->lock_object.lo_name, file, line));
if (mtx_owned(m))
-   KASSERT((m->lock_object.lo_flags & LO_RECURSABLE) != 0,
+   KASSERT((m->lock_object.lo_flags & LO_RECURSABLE) != 0 ||
+   (opts & MTX_RECURSE) != 0,
("mtx_lock_spin: recursed on non-recursive mutex %s @ %s:%d\n",
m->lock_object.lo_name, file, line));
+   opts &= ~MTX_RECURSE;
WITNESS_CHECKORDER(&m->lock_object, opts | LOP_NEWORDER | LOP_EXCLUSIVE,
file, line, NULL);
__mtx_lock_spin(m, curthread, opts, file, line);
@@ -335,12 +338,14 @@ _mtx_trylock_flags_(volatile uintptr_t *
("mtx_trylock() of spin mutex %s @ %s:%d", m->lock_object.lo_name,
file, line));
 
-   if (mtx_owned(m) && (m->lock_object.lo_flags & LO_RECURSABLE) != 0) {
+   if (mtx_owned(m) && ((m->lock_object.lo_flags & LO_RECURSABLE) != 0 ||
+   (opts & MTX_RECURSE) != 0)) {
m->mtx_recurse++;
atomic_set_ptr(&m->mtx_lock, MTX_RECURSED);
rval = 1;
} else
rval = _mtx_obtain_lock(m, (uintptr_t)curthread);
+   opts &= ~MTX_RECURSE;
 
LOCK_LOG_TRY("LOCK", &m->lock_object, opts, rval, file, line);
if (rval) {
@@ -391,15 +396,18 @@ __mtx_lock_sleep(volatile uintptr_t *c, 
m = mtxlock2mtx(c);
 
if (mtx_owned(m)) {
-   KASSERT((m->lock_object.lo_flags & LO_RECURSABLE) != 0,
+   KASSERT((m->lock_object.lo_flags & LO_RECURSABLE) != 0 ||
+   (opts & MTX_RECURSE) != 0,
("_mtx_lock_sleep: recursed on non-recursive mutex %s @ %s:%d\n",
m->lock_object.lo_name, file, line));
+   opts &= ~MTX_RECURSE;
m->mtx_recurse++;
atomic_set_ptr(&m->mtx_lock, MTX_RECURSED);
if (LOCK_LOG_TEST(&m->lock_object, opts))
CTR1(KTR_LOCK, "_mtx_lock_sleep: %p recursing", m);
return;
}
+   opts &= ~MTX_RECURSE;
 
 #ifdef HWPMC_HOOKS
PMC_SOFT_CALL( , , lock, failed);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r254140 - releng/9.2/contrib/libcxxrt

2013-08-09 Thread David Chisnall
Author: theraven
Date: Fri Aug  9 11:26:26 2013
New Revision: 254140
URL: http://svnweb.freebsd.org/changeset/base/254140

Log:
  Merge alignment fix for libcxxrt header.
  
  Approved by:  re

Modified:
  releng/9.2/contrib/libcxxrt/unwind-itanium.h
Directory Properties:
  releng/9.2/contrib/libcxxrt/   (props changed)

Modified: releng/9.2/contrib/libcxxrt/unwind-itanium.h
==
--- releng/9.2/contrib/libcxxrt/unwind-itanium.hFri Aug  9 11:24:29 
2013(r254139)
+++ releng/9.2/contrib/libcxxrt/unwind-itanium.hFri Aug  9 11:26:26 
2013(r254140)
@@ -80,7 +80,7 @@ struct _Unwind_Exception
 _Unwind_Exception_Cleanup_Fn exception_cleanup;
 unsigned long private_1;
 unsigned long private_2;
-  } __attribute__((__aligned__));
+  };
 
 extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *);
 extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r254141 - in head/sys: amd64/amd64 dev/drm2/i915 dev/drm2/ttm i386/i386 kern vm

2013-08-09 Thread Attilio Rao
Author: attilio
Date: Fri Aug  9 11:28:55 2013
New Revision: 254141
URL: http://svnweb.freebsd.org/changeset/base/254141

Log:
  On all the architectures, avoid to preallocate the physical memory
  for nodes used in vm_radix.
  On architectures supporting direct mapping, also avoid to pre-allocate
  the KVA for such nodes.
  
  In order to do so make the operations derived from vm_radix_insert()
  to fail and handle all the deriving failure of those.
  
  vm_radix-wise introduce a new function called vm_radix_replace(),
  which can replace a leaf node, already present, with a new one,
  and take into account the possibility, during vm_radix_insert()
  allocation, that the operations on the radix trie can recurse.
  This means that if operations in vm_radix_insert() recursed
  vm_radix_insert() will start from scratch again.
  
  Sponsored by: EMC / Isilon storage division
  Reviewed by:  alc (older version)
  Reviewed by:  jeff
  Tested by:pho, scottl

Modified:
  head/sys/amd64/amd64/pmap.c
  head/sys/dev/drm2/i915/i915_gem.c
  head/sys/dev/drm2/ttm/ttm_bo_vm.c
  head/sys/i386/i386/pmap.c
  head/sys/kern/subr_uio.c
  head/sys/vm/_vm_radix.h
  head/sys/vm/device_pager.c
  head/sys/vm/sg_pager.c
  head/sys/vm/vm_fault.c
  head/sys/vm/vm_object.c
  head/sys/vm/vm_object.h
  head/sys/vm/vm_page.c
  head/sys/vm/vm_page.h
  head/sys/vm/vm_radix.c
  head/sys/vm/vm_radix.h

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Fri Aug  9 11:26:26 2013(r254140)
+++ head/sys/amd64/amd64/pmap.c Fri Aug  9 11:28:55 2013(r254141)
@@ -283,7 +283,7 @@ static boolean_t pmap_enter_pde(pmap_t p
 static vm_page_t pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va,
 vm_page_t m, vm_prot_t prot, vm_page_t mpte, struct rwlock **lockp);
 static void pmap_fill_ptp(pt_entry_t *firstpte, pt_entry_t newpte);
-static void pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte);
+static int pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte);
 static boolean_t pmap_is_modified_pvh(struct md_page *pvh);
 static boolean_t pmap_is_referenced_pvh(struct md_page *pvh);
 static void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode);
@@ -1526,12 +1526,12 @@ pmap_add_delayed_free_list(vm_page_t m, 
  * for mapping a distinct range of virtual addresses.  The pmap's collection is
  * ordered by this virtual address range.
  */
-static __inline void
+static __inline int
 pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte)
 {
 
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
-   vm_radix_insert(&pmap->pm_root, mpte);
+   return (vm_radix_insert(&pmap->pm_root, mpte));
 }
 
 /*
@@ -3439,7 +3439,13 @@ setpte:
("pmap_promote_pde: page table page is out of range"));
KASSERT(mpte->pindex == pmap_pde_pindex(va),
("pmap_promote_pde: page table page's pindex is wrong"));
-   pmap_insert_pt_page(pmap, mpte);
+   if (pmap_insert_pt_page(pmap, mpte)) {
+   atomic_add_long(&pmap_pde_p_failures, 1);
+   CTR2(KTR_PMAP,
+   "pmap_promote_pde: failure for va %#lx in pmap %p", va,
+   pmap);
+   return;
+   }
 
/*
 * Promote the pv entries.

Modified: head/sys/dev/drm2/i915/i915_gem.c
==
--- head/sys/dev/drm2/i915/i915_gem.c   Fri Aug  9 11:26:26 2013
(r254140)
+++ head/sys/dev/drm2/i915/i915_gem.c   Fri Aug  9 11:28:55 2013
(r254141)
@@ -64,6 +64,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+#include 
+
 static void i915_gem_object_flush_cpu_write_domain(
 struct drm_i915_gem_object *obj);
 static uint32_t i915_gem_get_gtt_size(struct drm_device *dev, uint32_t size,
@@ -1443,8 +1446,14 @@ retry:
vm_page_busy_sleep(m, "915pbs");
goto retry;
}
+   if (vm_page_insert(m, vm_obj, OFF_TO_IDX(offset))) {
+   DRM_UNLOCK(dev);
+   VM_OBJECT_WUNLOCK(vm_obj);
+   VM_WAIT;
+   VM_OBJECT_WLOCK(vm_obj);
+   goto retry;
+   }
m->valid = VM_PAGE_BITS_ALL;
-   vm_page_insert(m, vm_obj, OFF_TO_IDX(offset));
 have_page:
*mres = m;
vm_page_xbusy(m);

Modified: head/sys/dev/drm2/ttm/ttm_bo_vm.c
==
--- head/sys/dev/drm2/ttm/ttm_bo_vm.c   Fri Aug  9 11:26:26 2013
(r254140)
+++ head/sys/dev/drm2/ttm/ttm_bo_vm.c   Fri Aug  9 11:28:55 2013
(r254141)
@@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 
 #define TTM_BO_VM_NUM_PREFAULT 16
 
@@ -221,16 +222,23 @@ reserve:
ttm_bo_unreserve(bo);
goto retry;
}
-   m->valid = VM_PAGE_BITS_ALL;
-   *mres = m;
m1 = vm_page_lookup(vm_obj, OFF_TO_IDX(offset));
if (m1 == NULL) {
-  

svn commit: r254144 - stable/9/sys/conf

2013-08-09 Thread Glen Barber
Author: gjb
Date: Fri Aug  9 12:19:38 2013
New Revision: 254144
URL: http://svnweb.freebsd.org/changeset/base/254144

Log:
  releng/9.2 was branched, so call this -PRERELEASE again for the duration
  of the 9.2-RELEASE cycle.

Modified:
  stable/9/sys/conf/newvers.sh

Modified: stable/9/sys/conf/newvers.sh
==
--- stable/9/sys/conf/newvers.shFri Aug  9 11:56:57 2013
(r254143)
+++ stable/9/sys/conf/newvers.shFri Aug  9 12:19:38 2013
(r254144)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="9.2"
-BRANCH="BETA2"
+BRANCH="PRERELEASE"
 if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r254146 - in stable/9/sys/boot: common i386/loader ia64/common pc98/loader powerpc/ofw powerpc/ps3 sparc64/loader

2013-08-09 Thread Devin Teske
Author: dteske
Date: Fri Aug  9 14:17:47 2013
New Revision: 254146
URL: http://svnweb.freebsd.org/changeset/base/254146

Log:
  MFC r242688: Hook in new files menusets.4th and manual.

Modified:
  stable/9/sys/boot/common/Makefile.inc
  stable/9/sys/boot/i386/loader/Makefile
  stable/9/sys/boot/ia64/common/Makefile
  stable/9/sys/boot/pc98/loader/Makefile
  stable/9/sys/boot/powerpc/ofw/Makefile
  stable/9/sys/boot/powerpc/ps3/Makefile
  stable/9/sys/boot/sparc64/loader/Makefile
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)

Modified: stable/9/sys/boot/common/Makefile.inc
==
--- stable/9/sys/boot/common/Makefile.inc   Fri Aug  9 12:31:02 2013
(r254145)
+++ stable/9/sys/boot/common/Makefile.inc   Fri Aug  9 14:17:47 2013
(r254146)
@@ -64,6 +64,7 @@ MAN+= ../forth/delay.4th.8
 MAN+=  ../forth/loader.conf.5
 MAN+=  ../forth/loader.4th.8
 MAN+=  ../forth/menu.4th.8
+MAN+=  ../forth/menusets.4th.8
 MAN+=  ../forth/version.4th.8
 .endif
 

Modified: stable/9/sys/boot/i386/loader/Makefile
==
--- stable/9/sys/boot/i386/loader/Makefile  Fri Aug  9 12:31:02 2013
(r254145)
+++ stable/9/sys/boot/i386/loader/Makefile  Fri Aug  9 14:17:47 2013
(r254146)
@@ -100,7 +100,7 @@ FILESMODE_${LOADER}= ${BINMODE} -b
 FILES+=loader.help loader.4th support.4th loader.conf
 FILES+= screen.4th frames.4th beastie.4th
 FILES+= brand.4th check-password.4th color.4th delay.4th
-FILES+= menu.4th menu-commands.4th shortcuts.4th version.4th
+FILES+= menu.4th menu-commands.4th menusets.4th shortcuts.4th version.4th
 FILESDIR_loader.conf=  /boot/defaults
 
 .if !exists(${DESTDIR}/boot/loader.rc)

Modified: stable/9/sys/boot/ia64/common/Makefile
==
--- stable/9/sys/boot/ia64/common/Makefile  Fri Aug  9 12:31:02 2013
(r254145)
+++ stable/9/sys/boot/ia64/common/Makefile  Fri Aug  9 14:17:47 2013
(r254146)
@@ -35,7 +35,7 @@ loader.help: help.common
 FILES+=loader.4th support.4th loader.conf
 FILES+=screen.4th frames.4th
 FILES+=beastie.4th brand.4th check-password.4th color.4th 
delay.4th
-FILES+=menu.4th menu-commands.4th shortcuts.4th version.4th
+FILES+=menu.4th menu-commands.4th menusets.4th shortcuts.4th 
version.4th
 .if !exists(${DESTDIR}/boot/loader.rc)
 FILES+=loader.rc
 .endif

Modified: stable/9/sys/boot/pc98/loader/Makefile
==
--- stable/9/sys/boot/pc98/loader/Makefile  Fri Aug  9 12:31:02 2013
(r254145)
+++ stable/9/sys/boot/pc98/loader/Makefile  Fri Aug  9 14:17:47 2013
(r254146)
@@ -88,7 +88,7 @@ FILESMODE_${LOADER}= ${BINMODE} -b
 FILES+=loader.help loader.4th support.4th loader.conf
 FILES+= screen.4th frames.4th beastie.4th
 FILES+= brand.4th check-password.4th color.4th delay.4th
-FILES+= menu.4th menu-commands.4th shortcuts.4th version.4th
+FILES+= menu.4th menu-commands.4th menusets.4th shortcuts.4th version.4th
 FILESDIR_loader.conf=  /boot/defaults
 
 .if !exists(${DESTDIR}/boot/loader.rc)

Modified: stable/9/sys/boot/powerpc/ofw/Makefile
==
--- stable/9/sys/boot/powerpc/ofw/Makefile  Fri Aug  9 12:31:02 2013
(r254145)
+++ stable/9/sys/boot/powerpc/ofw/Makefile  Fri Aug  9 14:17:47 2013
(r254146)
@@ -105,7 +105,7 @@ loader.help: help.common help.ofw
 FILES= loader.help loader.4th support.4th loader.conf
 FILES+=screen.4th frames.4th
 FILES+=beastie.4th brand.4th check-password.4th color.4th delay.4th
-FILES+=menu.4th menu-commands.4th shortcuts.4th version.4th
+FILES+=menu.4th menu-commands.4th menusets.4th shortcuts.4th 
version.4th
 FILESDIR_loader.conf=  /boot/defaults
 
 .if !exists(${DESTDIR}/boot/loader.rc)

Modified: stable/9/sys/boot/powerpc/ps3/Makefile
==
--- stable/9/sys/boot/powerpc/ps3/Makefile  Fri Aug  9 12:31:02 2013
(r254145)
+++ stable/9/sys/boot/powerpc/ps3/Makefile  Fri Aug  9 14:17:47 2013
(r254146)
@@ -116,7 +116,7 @@ loader.help: help.common help.ps3
 FILES= loader.help loader.4th support.4th loader.conf
 FILES+=screen.4th frames.4th
 FILES+=beastie.4th brand.4th check-password.4th color.4th delay.4th
-FILES+=menu.4th menu-commands.4th shortcuts.4th version.4th
+FILES+=menu.4th menu-commands.4th menusets.4th shortcuts.4th 
version.4th
 FILESDIR_loader.conf=  /boot/defaults
 
 .if !exists(${DESTDIR}/boot/loader.rc)

Modified: stable/9/sys/boo

svn commit: r254147 - in head: share/man/man4 sys/conf sys/dev/random tools/tools/sysdoc

2013-08-09 Thread David E. O'Brien
Author: obrien
Date: Fri Aug  9 15:31:50 2013
New Revision: 254147
URL: http://svnweb.freebsd.org/changeset/base/254147

Log:
  * Add random_adaptors.[ch] which is basically a store of random_adaptor's.
random_adaptor is basically an adapter that plugs in to random(4).
random_adaptor can only be plugged in to random(4) very early in bootup.
Unplugging random_adaptor from random(4) is not supported, and is probably a
bad idea anyway, due to potential loss of entropy pools.
We currently have 3 random_adaptors:
+ yarrow
+ rdrand (ivy.c)
+ nehemeiah
  
  * Remove platform dependent logic from probe.c, and move it into
corresponding registration routines of each random_adaptor provider.
probe.c doesn't do anything other than picking a specific random_adaptor
from a list of registered ones.
  
  * If the kernel doesn't have any random_adaptor adapters present then the
creation of /dev/random is postponed until next random_adaptor is 
kldload'ed.
  
  * Fix randomdev_soft.c to refer to its own random_adaptor, instead of a
system wide one.
  
  Submitted by: arthurm...@gmail.com, obrien
  Obtained from: Juniper Networks
  Reviewed by: so (des)

Added:
  head/sys/dev/random/random_adaptors.c   (contents, props changed)
  head/sys/dev/random/random_adaptors.h   (contents, props changed)
Modified:
  head/share/man/man4/random.4
  head/sys/conf/files
  head/sys/dev/random/ivy.c
  head/sys/dev/random/nehemiah.c
  head/sys/dev/random/probe.c
  head/sys/dev/random/randomdev.c
  head/sys/dev/random/randomdev.h
  head/sys/dev/random/randomdev_soft.c
  head/sys/dev/random/randomdev_soft.h
  head/sys/dev/random/yarrow.c
  head/tools/tools/sysdoc/tunables.mdoc

Modified: head/share/man/man4/random.4
==
--- head/share/man/man4/random.4Fri Aug  9 14:17:47 2013
(r254146)
+++ head/share/man/man4/random.4Fri Aug  9 15:31:50 2013
(r254147)
@@ -23,7 +23,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 7, 2012
+.Dd August 7, 2013
 .Dt RANDOM 4
 .Os
 .Sh NAME
@@ -43,6 +43,13 @@ The device will probe for
 certain hardware entropy sources,
 and use these in preference to the fallback,
 which is a generator implemented in software.
+If the kernel environment MIB's
+.Va hw.nehemiah_rng_enable
+or
+.Va hw.ivy_rng_enable
+are set to
+.Dq Li 0 ,
+the associated hardware entropy source will be ignored.
 .Pp
 If the device is using
 the software generator,
@@ -74,6 +81,7 @@ device, use the command line:
 .Pp
 which results in something like:
 .Bd -literal -offset indent
+kern.random.adaptors: yarrow
 kern.random.sys.seeded: 1
 kern.random.sys.harvest.ethernet: 1
 kern.random.sys.harvest.point_to_point: 1
@@ -89,7 +97,9 @@ kern.random.yarrow.slowoverthresh: 2
 (These would not be seen if a
 hardware generator is present.)
 .Pp
-All settings are read/write.
+Other than
+.Dl kern.random.adaptors
+all settings are read/write.
 .Pp
 The
 .Va kern.random.sys.seeded

Modified: head/sys/conf/files
==
--- head/sys/conf/files Fri Aug  9 14:17:47 2013(r254146)
+++ head/sys/conf/files Fri Aug  9 15:31:50 2013(r254147)
@@ -2032,6 +2032,7 @@ rt2860.fw optional rt2860fw | ralfw   
\
 dev/random/harvest.c   standard
 dev/random/hash.c  optional random
 dev/random/probe.c optional random
+dev/random/random_adaptors.c   standard
 dev/random/randomdev.c optional random
 dev/random/randomdev_soft.coptional random
 dev/random/yarrow.coptional random

Modified: head/sys/dev/random/ivy.c
==
--- head/sys/dev/random/ivy.c   Fri Aug  9 14:17:47 2013(r254146)
+++ head/sys/dev/random/ivy.c   Fri Aug  9 15:31:50 2013(r254147)
@@ -1,4 +1,5 @@
 /*-
+ * Copyright (c) 2013 David E. O'Brien 
  * Copyright (c) 2012 Konstantin Belousov 
  * All rights reserved.
  *
@@ -28,16 +29,19 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "opt_cpu.h"
-
-#ifdef RDRAND_RNG
-
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
+
+#include 
+#include 
+
+#include 
 #include 
 
 #defineRETRY_COUNT 10
@@ -46,7 +50,7 @@ static void random_ivy_init(void);
 static void random_ivy_deinit(void);
 static int random_ivy_read(void *, int);
 
-struct random_systat random_ivy = {
+struct random_adaptor random_ivy = {
.ident = "Hardware, Intel IvyBridge+ RNG",
.init = random_ivy_init,
.deinit = random_ivy_deinit,
@@ -114,4 +118,28 @@ random_ivy_read(void *buf, int c)
return (c - count);
 }
 
+static int
+rdrand_modevent(module_t mod, int type, void *unused)
+{
+
+   switch (type) {
+   case MOD_LOAD:
+   if (cpu_feature2 & CPUID2_RDRAND) {
+   random_adaptor_register("r

Re: svn commit: r253996 - in head: . sys/cddl/compat/opensolaris/sys sys/cddl/dev/dtrace sys/conf sys/modules/cyclic sys/modules/dtrace/dtio sys/modules/dtrace/dtmalloc sys/modules/dtrace/dtnfscl sys/

2013-08-09 Thread David O'Brien
On Tue, Aug 06, 2013 at 03:51:56PM +, Andriy Gapon wrote:
> Log:
..
>   Also, meaning of DEBUG was overloaded to enable WITNESS support for some
>   OpenSolaris (primarily ZFS) locks.  Now this overloading is removed and
>   that use of DEBUG is replaced with a new option OPENSOLARIS_WITNESS.

You state there is little value in witness tracking for ZFS in UPDATING.
Is there no reasonable way to gain useful lock tracking for ZFS?

At a minimum, shouldn't this also be added to sys/conf/NOTES in the
"# SMP Debugging Options:" section?

-- 
-- David  (obr...@freebsd.org)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r254141 - in head/sys: amd64/amd64 dev/drm2/i915 dev/drm2/ttm i386/i386 kern vm

2013-08-09 Thread Tijl Coosemans
On Fri, 9 Aug 2013 11:28:56 + (UTC) Attilio Rao wrote:
> Author: attilio
> Date: Fri Aug  9 11:28:55 2013
> New Revision: 254141
> URL: http://svnweb.freebsd.org/changeset/base/254141
> 
> Log:
>   On all the architectures, avoid to preallocate the physical memory
>   for nodes used in vm_radix.
>   On architectures supporting direct mapping, also avoid to pre-allocate
>   the KVA for such nodes.
>   
>   In order to do so make the operations derived from vm_radix_insert()
>   to fail and handle all the deriving failure of those.
>   
>   vm_radix-wise introduce a new function called vm_radix_replace(),
>   which can replace a leaf node, already present, with a new one,
>   and take into account the possibility, during vm_radix_insert()
>   allocation, that the operations on the radix trie can recurse.
>   This means that if operations in vm_radix_insert() recursed
>   vm_radix_insert() will start from scratch again.
>   
>   Sponsored by:   EMC / Isilon storage division
>   Reviewed by:alc (older version)
>   Reviewed by:jeff
>   Tested by:  pho, scottl

VPO_BUSY doesn't appear to be defined anywhere:

cc  -c -O -pipe -march=pentium4m -std=c99 -g -Wall -Wredundant-decls 
-Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith 
-Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions  
-Wmissing-include-dirs -fdiagnostics-show-option  
-Wno-error-tautological-compare -Wno-error-empty-body  
-Wno-error-parentheses-equality  -nostdinc  -I. 
-I/usr/home/tijl/projects/freebsd/base/head/sys 
-I/usr/home/tijl/projects/freebsd/base/head/sys/contrib/altq 
-I/usr/home/tijl/projects/freebsd/base/head/sys/contrib/libfdt -D_KERNEL 
-DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h  -mno-aes -mno-avx -mno-mmx 
-mno-sse -msoft-float -ffreestanding -fstack-protector -Werror  
/usr/home/tijl/projects/freebsd/base/head/sys/vm/vm_page.c
/usr/home/tijl/projects/freebsd/base/head/sys/vm/vm_page.c:1205:21: error: use 
of undeclared identifier 'VPO_BUSY'
if (mold->oflags & VPO_BUSY) {
   ^
/usr/home/tijl/projects/freebsd/base/head/sys/vm/vm_page.c:1206:20: error: use 
of undeclared identifier 'VPO_BUSY'
mold->oflags &= ~VPO_BUSY;
 ^
2 errors generated.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r254148 - stable/9/sys/fs/ext2fs

2013-08-09 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Aug  9 16:27:51 2013
New Revision: 254148
URL: http://svnweb.freebsd.org/changeset/base/254148

Log:
  MFC   r253173:
  
  Implement 1003.1-2001 pathconf() keys.
  This is based on r106058 in UFS.

Modified:
  stable/9/sys/fs/ext2fs/ext2_vnops.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/fs/   (props changed)

Modified: stable/9/sys/fs/ext2fs/ext2_vnops.c
==
--- stable/9/sys/fs/ext2fs/ext2_vnops.c Fri Aug  9 15:31:50 2013
(r254147)
+++ stable/9/sys/fs/ext2fs/ext2_vnops.c Fri Aug  9 16:27:51 2013
(r254148)
@@ -1416,33 +1416,68 @@ ext2fifo_kqfilter(struct vop_kqfilter_ar
 static int
 ext2_pathconf(struct vop_pathconf_args *ap)
 {
+   int error = 0;
 
switch (ap->a_name) {
case _PC_LINK_MAX:
*ap->a_retval = EXT2_LINK_MAX;
-   return (0);
+   break;
case _PC_NAME_MAX:
*ap->a_retval = NAME_MAX;
-   return (0);
+   break;
case _PC_PATH_MAX:
*ap->a_retval = PATH_MAX;
-   return (0);
+   break;
case _PC_PIPE_BUF:
*ap->a_retval = PIPE_BUF;
-   return (0);
+   break;
case _PC_CHOWN_RESTRICTED:
*ap->a_retval = 1;
-   return (0);
+   break;
case _PC_NO_TRUNC:
*ap->a_retval = 1;
-   return (0);
+   break;
case _PC_MIN_HOLE_SIZE:
*ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize;
-   return(0);
+   break;
+   case _PC_ASYNC_IO:
+   /* _PC_ASYNC_IO should have been handled by upper layers. */
+   KASSERT(0, ("_PC_ASYNC_IO should not get here"));
+   error = EINVAL;
+   break;
+   case _PC_PRIO_IO:
+   *ap->a_retval = 0;
+   break;
+   case _PC_SYNC_IO:
+   *ap->a_retval = 0;
+   break;
+   case _PC_ALLOC_SIZE_MIN:
+   *ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_bsize;
+   break;
+   case _PC_FILESIZEBITS:
+   *ap->a_retval = 64;
+   break;
+   case _PC_REC_INCR_XFER_SIZE:
+   *ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize;
+   break;
+   case _PC_REC_MAX_XFER_SIZE:
+   *ap->a_retval = -1; /* means ``unlimited'' */
+   break;
+   case _PC_REC_MIN_XFER_SIZE:
+   *ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize;
+   break;
+   case _PC_REC_XFER_ALIGN:
+   *ap->a_retval = PAGE_SIZE;
+   break;
+   case _PC_SYMLINK_MAX:
+   *ap->a_retval = MAXPATHLEN;
+   break;
+
default:
-   return (EINVAL);
+   error = EINVAL;
+   break;
}
-   /* NOTREACHED */
+   return (error);
 }
 
 /*
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r254149 - releng/9.2/sys/modules/ixgbe

2013-08-09 Thread Jack F Vogel
Author: jfv
Date: Fri Aug  9 16:34:12 2013
New Revision: 254149
URL: http://svnweb.freebsd.org/changeset/base/254149

Log:
  Automate inet option file creation for module build, change module name to
  if_ixgbe, this sync's the Makefile with HEAD.
  
  Approved by:  re

Modified:
  releng/9.2/sys/modules/ixgbe/Makefile
Directory Properties:
  releng/9.2/sys/   (props changed)
  releng/9.2/sys/modules/   (props changed)
  releng/9.2/sys/modules/ixgbe/   (props changed)

Modified: releng/9.2/sys/modules/ixgbe/Makefile
==
--- releng/9.2/sys/modules/ixgbe/Makefile   Fri Aug  9 16:27:51 2013
(r254148)
+++ releng/9.2/sys/modules/ixgbe/Makefile   Fri Aug  9 16:34:12 2013
(r254149)
@@ -1,7 +1,12 @@
 #$FreeBSD$
+
+.include 
+
 .PATH:  ${.CURDIR}/../../dev/ixgbe
-KMOD= ixgbe
+
+KMOD= if_ixgbe
 SRCS= device_if.h bus_if.h pci_if.h
+SRCS   += opt_inet.h opt_inet6.h
 SRCS+= ixgbe.c ixv.c
 # Shared source
 SRCS+= ixgbe_common.c ixgbe_api.c ixgbe_phy.c ixgbe_mbx.c ixgbe_vf.c
@@ -9,4 +14,16 @@ SRCS+= ixgbe_dcb.c ixgbe_dcb_82598.c
 SRCS+= ixgbe_82599.c ixgbe_82598.c ixgbe_x540.c
 CFLAGS+= -I${.CURDIR}/../../dev/ixgbe -DSMP -DIXGBE_FDIR
 
+.if !defined(KERNBUILDDIR)
+.if ${MK_INET_SUPPORT} != "no"
+opt_inet.h:
+   @echo "#define INET 1" > ${.TARGET}
+.endif
+
+.if ${MK_INET6_SUPPORT} != "no"
+opt_inet6.h:
+   @echo "#define INET6 1" > ${.TARGET}
+.endif
+.endif
+
 .include 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r254139 - in head: share/man/man9 sys/kern

2013-08-09 Thread John Baldwin
On Friday, August 09, 2013 7:24:29 am Attilio Rao wrote:
> Author: attilio
> Date: Fri Aug  9 11:24:29 2013
> New Revision: 254139
> URL: http://svnweb.freebsd.org/changeset/base/254139
> 
> Log:
>   Give mutex(9) the ability to recurse on a per-instance basis.
>   Now the MTX_RECURSE flag can be passed to the mtx_*_flag() calls.
>   This helps in cases we want to narrow down to specific calls the
>   possibility to recurse for some locks.

It would perhaps be better for the ops passed to WITNESS to be opt-in
rather than opt-out, so that you use 'opts & LOP_QUIET | foo' rather
than 'opts & ~MTX_RECURSE | foo'.

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r254150 - head/sys/vm

2013-08-09 Thread David E. O'Brien
Author: obrien
Date: Fri Aug  9 16:43:50 2013
New Revision: 254150
URL: http://svnweb.freebsd.org/changeset/base/254150

Log:
  Add missing 'VPO_BUSY' from r254141 to fix kernel build break.

Modified:
  head/sys/vm/vm_page.h

Modified: head/sys/vm/vm_page.h
==
--- head/sys/vm/vm_page.h   Fri Aug  9 16:34:12 2013(r254149)
+++ head/sys/vm/vm_page.h   Fri Aug  9 16:43:50 2013(r254150)
@@ -171,6 +171,7 @@ struct vm_page {
 #defineVPO_UNMANAGED   0x04/* no PV management for page */
 #defineVPO_SWAPINPROG  0x08/* swap I/O in progress on page 
*/
 #defineVPO_NOSYNC  0x10/* do not collect for syncer */
+#defineVPO_BUSY0x20/* TBD */
 
 /*
  * Busy page implementation details.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r254151 - in head: include lib/libc/stdio tools/regression/lib/libc/stdio

2013-08-09 Thread Jilles Tjoelker
Author: jilles
Date: Fri Aug  9 17:24:23 2013
New Revision: 254151
URL: http://svnweb.freebsd.org/changeset/base/254151

Log:
  Add mkostemp() and mkostemps().
  
  These are like mkstemp() and mkstemps() but allow passing open(2) flags like
  O_CLOEXEC.

Added:
  head/tools/regression/lib/libc/stdio/test-mkostemp.c   (contents, props 
changed)
Modified:
  head/include/stdlib.h
  head/lib/libc/stdio/Makefile.inc
  head/lib/libc/stdio/Symbol.map
  head/lib/libc/stdio/mktemp.3
  head/lib/libc/stdio/mktemp.c
  head/tools/regression/lib/libc/stdio/Makefile

Modified: head/include/stdlib.h
==
--- head/include/stdlib.h   Fri Aug  9 16:43:50 2013(r254150)
+++ head/include/stdlib.h   Fri Aug  9 17:24:23 2013(r254151)
@@ -282,6 +282,8 @@ const char *
 int heapsort(void *, size_t, size_t, int (*)(const void *, const void *));
 int l64a_r(long, char *, int);
 int mergesort(void *, size_t, size_t, int (*)(const void *, const void *));
+int mkostemp(char *, int);
+int mkostemps(char *, int, int);
 voidqsort_r(void *, size_t, size_t, void *,
int (*)(void *, const void *, const void *));
 int radixsort(const unsigned char **, int, const unsigned char *,

Modified: head/lib/libc/stdio/Makefile.inc
==
--- head/lib/libc/stdio/Makefile.incFri Aug  9 16:43:50 2013
(r254150)
+++ head/lib/libc/stdio/Makefile.incFri Aug  9 17:24:23 2013
(r254151)
@@ -60,7 +60,8 @@ MLINKS+=getc.3 fgetc.3 getc.3 getc_unloc
getc.3 getchar_unlocked.3 getc.3 getw.3
 MLINKS+=getline.3 getdelim.3
 MLINKS+=getwc.3 fgetwc.3 getwc.3 getwchar.3
-MLINKS+=mktemp.3 mkdtemp.3 mktemp.3 mkstemp.3 mktemp.3 mkstemps.3
+MLINKS+=mktemp.3 mkdtemp.3 mktemp.3 mkstemp.3 mktemp.3 mkstemps.3 \
+   mktemp.3 mkostemp.3 mktemp.3 mkostemps.3
 MLINKS+=open_memstream.3 open_wmemstream.3
 MLINKS+=printf.3 asprintf.3 printf.3 dprintf.3 printf.3 fprintf.3 \
printf.3 snprintf.3 printf.3 sprintf.3 \

Modified: head/lib/libc/stdio/Symbol.map
==
--- head/lib/libc/stdio/Symbol.map  Fri Aug  9 16:43:50 2013
(r254150)
+++ head/lib/libc/stdio/Symbol.map  Fri Aug  9 17:24:23 2013
(r254151)
@@ -158,6 +158,8 @@ FBSD_1.3 {
fmemopen;
open_memstream;
open_wmemstream;
+   mkostemp;
+   mkostemps;
 };
 
 FBSDprivate_1.0 {

Modified: head/lib/libc/stdio/mktemp.3
==
--- head/lib/libc/stdio/mktemp.3Fri Aug  9 16:43:50 2013
(r254150)
+++ head/lib/libc/stdio/mktemp.3Fri Aug  9 17:24:23 2013
(r254151)
@@ -28,7 +28,7 @@
 .\" @(#)mktemp.3   8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd July 5, 2013
+.Dd August 8, 2013
 .Dt MKTEMP 3
 .Os
 .Sh NAME
@@ -42,6 +42,10 @@
 .Fn mktemp "char *template"
 .Ft int
 .Fn mkstemp "char *template"
+.Ft int
+.Fn mkostemp "char *template" "int oflags"
+.Ft int
+.Fn mkostemps "char *template" "int suffixlen" "int oflags"
 .Ft char *
 .Fn mkdtemp "char *template"
 .In unistd.h
@@ -85,16 +89,41 @@ This avoids the race between testing for
 for use.
 .Pp
 The
+.Fn mkostemp
+function
+is like
+.Fn mkstemp
+but allows specifying additional
+.Xr open 2
+flags (defined in
+.In fcntl.h ) .
+The permitted flags are
+.Dv O_APPEND ,
+.Dv O_DIRECT ,
+.Dv O_SHLOCK ,
+.Dv O_EXLOCK ,
+.Dv O_SYNC
+and
+.Dv O_CLOEXEC .
+.Pp
+The
 .Fn mkstemps
-function acts the same as
-.Fn mkstemp ,
-except it permits a suffix to exist in the template.
+and
+.Fn mkostemps
+functions act the same as
+.Fn mkstemp
+and
+.Fn mkostemp
+respectively,
+except they permit a suffix to exist in the template.
 The template should be of the form
 .Pa /tmp/tmpXXsuffix .
 The
 .Fn mkstemps
+and
+.Fn mkostemps
 function
-is told the length of the suffix string.
+are told the length of the suffix string.
 .Pp
 The
 .Fn mkdtemp
@@ -110,9 +139,11 @@ functions return a pointer to the templa
 .Dv NULL
 on failure.
 The
-.Fn mkstemp
-and
+.Fn mkstemp ,
+.Fn mkostemp
 .Fn mkstemps
+and
+.Fn mkostemps
 functions
 return \-1 if no suitable file could be created.
 If either call fails an error code is placed in the global variable
@@ -120,7 +151,9 @@ If either call fails an error code is pl
 .Sh ERRORS
 The
 .Fn mkstemp ,
-.Fn mkstemps
+.Fn mkostemp ,
+.Fn mkstemps ,
+.Fn mkostemps
 and
 .Fn mkdtemp
 functions
@@ -133,8 +166,25 @@ The pathname portion of the template is 
 .El
 .Pp
 The
+.Fn mkostemp
+and
+.Fn mkostemps
+functions
+may also set
+.Va errno
+to the following value:
+.Bl -tag -width Er
+.It Bq Er EINVAL
+The
+.Fa oflags
+argument is invalid.
+.El
+.Pp
+The
 .Fn mkstemp ,
-.Fn mkstemps
+.Fn mkostemp ,
+.Fn mkstemps ,
+.Fn mkostemps
 and
 .Fn mkdtemp
 functions
@@ -145,9 +195,11 @@ to any value specified by the
 function

svn commit: r254152 - stable/9/sys/ufs/ufs

2013-08-09 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Aug  9 17:52:56 2013
New Revision: 254152
URL: http://svnweb.freebsd.org/changeset/base/254152

Log:
  MFC   r252435, r252437, r253163:
  Change i_gen in UFS to an unsigned type.
  
  In UFS, i_gen is a random generated value and there is not way for
  it to be negative. Actually, the value of i_gen is just used to
  match bit patterns and it is of no consequence if the values are
  signed or not. Following other filesystems, set it to unsigned,
  
  Calculation for older filesystems remains untouched.

Modified:
  stable/9/sys/ufs/ufs/dinode.h
  stable/9/sys/ufs/ufs/inode.h
  stable/9/sys/ufs/ufs/ufs_extattr.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/ufs/ufs/dinode.h
==
--- stable/9/sys/ufs/ufs/dinode.h   Fri Aug  9 17:24:23 2013
(r254151)
+++ stable/9/sys/ufs/ufs/dinode.h   Fri Aug  9 17:52:56 2013
(r254152)
@@ -138,7 +138,7 @@ struct ufs2_dinode {
int32_t di_atimensec;   /*  68: Last access time. */
int32_t di_ctimensec;   /*  72: Last inode change time. */
int32_t di_birthnsec;   /*  76: Inode creation time. */
-   int32_t di_gen; /*  80: Generation number. */
+   u_int32_t   di_gen; /*  80: Generation number. */
u_int32_t   di_kernflags;   /*  84: Kernel flags. */
u_int32_t   di_flags;   /*  88: Status flags (chflags). */
int32_t di_extsize; /*  92: External attributes block. */
@@ -180,7 +180,7 @@ struct ufs1_dinode {
ufs1_daddr_tdi_ib[NIADDR];  /*  88: Indirect disk blocks. */
u_int32_t   di_flags;   /* 100: Status flags (chflags). */
int32_t di_blocks;  /* 104: Blocks actually held. */
-   int32_t di_gen; /* 108: Generation number. */
+   u_int32_t   di_gen; /* 108: Generation number. */
u_int32_t   di_uid; /* 112: File owner. */
u_int32_t   di_gid; /* 116: File group. */
u_int64_t   di_modrev;  /* 120: i_modrev for NFSv4 */

Modified: stable/9/sys/ufs/ufs/inode.h
==
--- stable/9/sys/ufs/ufs/inode.hFri Aug  9 17:24:23 2013
(r254151)
+++ stable/9/sys/ufs/ufs/inode.hFri Aug  9 17:52:56 2013
(r254152)
@@ -102,7 +102,7 @@ struct inode {
int16_t   i_nlink;  /* File link count. */
u_int64_t i_size;   /* File byte count. */
u_int32_t i_flags;  /* Status flags (chflags). */
-   int64_t   i_gen;/* Generation number. */
+   u_int64_t i_gen;/* Generation number. */
u_int32_t i_uid;/* File owner. */
u_int32_t i_gid;/* File group. */
/*
@@ -180,7 +180,7 @@ struct ufid {
u_int16_t ufid_len; /* Length of structure. */
u_int16_t ufid_pad; /* Force 32-bit alignment. */
ino_t ufid_ino; /* File number (ino). */
-   int32_t   ufid_gen; /* Generation number. */
+   uint32_t  ufid_gen; /* Generation number. */
 };
 #endif /* _KERNEL */
 

Modified: stable/9/sys/ufs/ufs/ufs_extattr.c
==
--- stable/9/sys/ufs/ufs/ufs_extattr.c  Fri Aug  9 17:24:23 2013
(r254151)
+++ stable/9/sys/ufs/ufs/ufs_extattr.c  Fri Aug  9 17:52:56 2013
(r254152)
@@ -932,8 +932,8 @@ ufs_extattr_get(struct vnode *vp, int at
 * is to coerce this to undefined, and let it get cleaned
 * up by the next write or extattrctl clean.
 */
-   printf("ufs_extattr_get (%s): inode number inconsistency (%d, 
%jd)\n",
-   mp->mnt_stat.f_mntonname, ueh.ueh_i_gen, 
(intmax_t)ip->i_gen);
+   printf("ufs_extattr_get (%s): inode number inconsistency (%d, 
%ju)\n",
+   mp->mnt_stat.f_mntonname, ueh.ueh_i_gen, 
(uintmax_t)ip->i_gen);
error = ENOATTR;
goto vopunlock_exit;
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r253996 - in head: . sys/cddl/compat/opensolaris/sys sys/cddl/dev/dtrace sys/conf sys/modules/cyclic sys/modules/dtrace/dtio sys/modules/dtrace/dtmalloc sys/modules/dtrace/dtnfscl sys/

2013-08-09 Thread Andriy Gapon
on 09/08/2013 18:48 David O'Brien said the following:
> On Tue, Aug 06, 2013 at 03:51:56PM +, Andriy Gapon wrote:
>> Log:
> ..
>>   Also, meaning of DEBUG was overloaded to enable WITNESS support for some
>>   OpenSolaris (primarily ZFS) locks.  Now this overloading is removed and
>>   that use of DEBUG is replaced with a new option OPENSOLARIS_WITNESS.
> 
> You state there is little value in witness tracking for ZFS in UPDATING.

That's not completely true.  If there is a new report then it deserves
attention.  The problem is that there are just too many reports.  So probably
only someone hacking on ZFS and knowing where to look / what to suspect can
benefit from OPENSOLARIS_WITNESS.

> Is there no reasonable way to gain useful lock tracking for ZFS?

Honestly - I don't know.

> At a minimum, shouldn't this also be added to sys/conf/NOTES in the
> "# SMP Debugging Options:" section?

This commit has not changed status quo.
But what you suggest does make sense.

-- 
Andriy Gapon
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r254153 - stable/9/sys/dev/aac

2013-08-09 Thread Marius Strobl
Author: marius
Date: Fri Aug  9 18:54:27 2013
New Revision: 254153
URL: http://svnweb.freebsd.org/changeset/base/254153

Log:
  MFC: 254004
  
  As it turns out, MSIs are broken with 2820SA so introduce an AAC_FLAGS_NOMSI
  quirk and apply it to these controllers [1]. The same problem was reported
  for 2230S, in which case it wasn't actually clear whether the culprit is the
  controller or the mainboard, though. In order to be on the safe side, flag
  MSIs as being broken with the latter type of controller as well. Given that
  these are the only reports of MSI-related breakage with aac(4) so far and
  OSes like OpenSolaris unconditionally employ MSIs for all adapters of this
  family, however, it doesn't seem warranted to generally disable the use of
  MSIs in aac(4).
  While at it, simplify the MSI allocation logic a bit; there's no need to
  check for the presence of the MSI capability on our own as pci_alloc_msi(9)
  will just fail when these kind of interrupts are not available.
  Reported and tested by: David Boyd [1]

Modified:
  stable/9/sys/dev/aac/aac_pci.c
  stable/9/sys/dev/aac/aacvar.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/aac/aac_pci.c
==
--- stable/9/sys/dev/aac/aac_pci.c  Fri Aug  9 17:52:56 2013
(r254152)
+++ stable/9/sys/dev/aac/aac_pci.c  Fri Aug  9 18:54:27 2013
(r254153)
@@ -139,7 +139,7 @@ static const struct aac_ident
 "Adaptec SATA RAID 21610SA"},
{0x9005, 0x0285, 0x103c, 0x3227, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB,
 "HP ML110 G2 (Adaptec 2610SA)"},
-   {0x9005, 0x0286, 0x9005, 0x028c, AAC_HWIF_RKT, 0,
+   {0x9005, 0x0286, 0x9005, 0x028c, AAC_HWIF_RKT, AAC_FLAGS_NOMSI,
 "Adaptec SCSI RAID 2230S"},
{0x9005, 0x0286, 0x9005, 0x028d, AAC_HWIF_RKT, 0,
 "Adaptec SCSI RAID 2130S"},
@@ -157,7 +157,7 @@ static const struct aac_ident
 "Adaptec SCSI RAID 2020ZCR"},
{0x9005, 0x0285, 0x9005, 0x028b, AAC_HWIF_I960RX, 0,
 "Adaptec SCSI RAID 2025ZCR"},
-   {0x9005, 0x0286, 0x9005, 0x029b, AAC_HWIF_RKT, 0,
+   {0x9005, 0x0286, 0x9005, 0x029b, AAC_HWIF_RKT, AAC_FLAGS_NOMSI,
 "Adaptec SATA RAID 2820SA"},
{0x9005, 0x0286, 0x9005, 0x029c, AAC_HWIF_RKT, 0,
 "Adaptec SATA RAID 2620SA"},
@@ -311,7 +311,6 @@ aac_find_ident(device_t dev)
if ((m->vendor == vendid) && (m->device == devid))
return (m);
}
-
return (NULL);
 }
 
@@ -340,7 +339,7 @@ aac_pci_attach(device_t dev)
 {
struct aac_softc *sc;
const struct aac_ident *id;
-   int count, error, reg, rid;
+   int count, error, rid;
 
fwprintf(NULL, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
 
@@ -363,6 +362,38 @@ aac_pci_attach(device_t dev)
}
 
/*
+* Detect the hardware interface version, set up the bus interface
+* indirection.
+*/
+   id = aac_find_ident(dev);
+   sc->aac_hwif = id->hwif;
+   switch(sc->aac_hwif) {
+   case AAC_HWIF_I960RX:
+   case AAC_HWIF_NARK:
+   fwprintf(sc, HBA_FLAGS_DBG_INIT_B,
+   "set hardware up for i960Rx/NARK");
+   sc->aac_if = &aac_rx_interface;
+   break;
+   case AAC_HWIF_STRONGARM:
+   fwprintf(sc, HBA_FLAGS_DBG_INIT_B,
+   "set hardware up for StrongARM");
+   sc->aac_if = &aac_sa_interface;
+   break;
+   case AAC_HWIF_RKT:
+   fwprintf(sc, HBA_FLAGS_DBG_INIT_B,
+   "set hardware up for Rocket/MIPS");
+   sc->aac_if = &aac_rkt_interface;
+   break;
+   default:
+   sc->aac_hwif = AAC_HWIF_UNKNOWN;
+   device_printf(dev, "unknown hardware type\n");
+   goto out;
+   }
+
+   /* Set up quirks */
+   sc->flags = id->quirks;
+
+   /*
 * Allocate the PCI register window(s).
 */
rid = PCIR_BAR(0);
@@ -395,8 +426,8 @@ aac_pci_attach(device_t dev)
 */
rid = 0;
count = 0;
-   if (aac_enable_msi != 0 && pci_find_cap(dev, PCIY_MSI, ®) == 0) {
-   count = pci_msi_count(dev);
+   if (aac_enable_msi != 0 && (sc->flags & AAC_FLAGS_NOMSI) == 0 &&
+   (count = pci_msi_count(dev)) != 0) {
if (count > 1)
count = 1;
else
@@ -431,36 +462,6 @@ aac_pci_attach(device_t dev)
}
 
/*
-* Detect the hardware interface version, set up the bus interface
-* indirection.
-*/
-   id = aac_find_ident(dev);
-   sc->aac_hwif = id->hwif;
-   switch(sc->aac_hwif) {
-   case AAC_HWIF_I960RX:
-   case AAC_HWIF_NARK:
-   fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for 
i960Rx/NARK");
-   sc->aac_if 

svn commit: r254154 - releng/9.2/sys/dev/aac

2013-08-09 Thread Marius Strobl
Author: marius
Date: Fri Aug  9 18:57:18 2013
New Revision: 254154
URL: http://svnweb.freebsd.org/changeset/base/254154

Log:
  MFC: r254004
  
  As it turns out, MSIs are broken with 2820SA so introduce an AAC_FLAGS_NOMSI
  quirk and apply it to these controllers [1]. The same problem was reported
  for 2230S, in which case it wasn't actually clear whether the culprit is the
  controller or the mainboard, though. In order to be on the safe side, flag
  MSIs as being broken with the latter type of controller as well. Given that
  these are the only reports of MSI-related breakage with aac(4) so far and
  OSes like OpenSolaris unconditionally employ MSIs for all adapters of this
  family, however, it doesn't seem warranted to generally disable the use of
  MSIs in aac(4).
  While at it, simplify the MSI allocation logic a bit; there's no need to
  check for the presence of the MSI capability on our own as pci_alloc_msi(9)
  will just fail when these kind of interrupts are not available.
  Reported and tested by: David Boyd [1]
  
  Approved by:  re (kib)

Modified:
  releng/9.2/sys/dev/aac/aac_pci.c
  releng/9.2/sys/dev/aac/aacvar.h
Directory Properties:
  releng/9.2/sys/   (props changed)
  releng/9.2/sys/dev/   (props changed)

Modified: releng/9.2/sys/dev/aac/aac_pci.c
==
--- releng/9.2/sys/dev/aac/aac_pci.cFri Aug  9 18:54:27 2013
(r254153)
+++ releng/9.2/sys/dev/aac/aac_pci.cFri Aug  9 18:57:18 2013
(r254154)
@@ -139,7 +139,7 @@ static const struct aac_ident
 "Adaptec SATA RAID 21610SA"},
{0x9005, 0x0285, 0x103c, 0x3227, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB,
 "HP ML110 G2 (Adaptec 2610SA)"},
-   {0x9005, 0x0286, 0x9005, 0x028c, AAC_HWIF_RKT, 0,
+   {0x9005, 0x0286, 0x9005, 0x028c, AAC_HWIF_RKT, AAC_FLAGS_NOMSI,
 "Adaptec SCSI RAID 2230S"},
{0x9005, 0x0286, 0x9005, 0x028d, AAC_HWIF_RKT, 0,
 "Adaptec SCSI RAID 2130S"},
@@ -157,7 +157,7 @@ static const struct aac_ident
 "Adaptec SCSI RAID 2020ZCR"},
{0x9005, 0x0285, 0x9005, 0x028b, AAC_HWIF_I960RX, 0,
 "Adaptec SCSI RAID 2025ZCR"},
-   {0x9005, 0x0286, 0x9005, 0x029b, AAC_HWIF_RKT, 0,
+   {0x9005, 0x0286, 0x9005, 0x029b, AAC_HWIF_RKT, AAC_FLAGS_NOMSI,
 "Adaptec SATA RAID 2820SA"},
{0x9005, 0x0286, 0x9005, 0x029c, AAC_HWIF_RKT, 0,
 "Adaptec SATA RAID 2620SA"},
@@ -311,7 +311,6 @@ aac_find_ident(device_t dev)
if ((m->vendor == vendid) && (m->device == devid))
return (m);
}
-
return (NULL);
 }
 
@@ -340,7 +339,7 @@ aac_pci_attach(device_t dev)
 {
struct aac_softc *sc;
const struct aac_ident *id;
-   int count, error, reg, rid;
+   int count, error, rid;
 
fwprintf(NULL, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
 
@@ -363,6 +362,38 @@ aac_pci_attach(device_t dev)
}
 
/*
+* Detect the hardware interface version, set up the bus interface
+* indirection.
+*/
+   id = aac_find_ident(dev);
+   sc->aac_hwif = id->hwif;
+   switch(sc->aac_hwif) {
+   case AAC_HWIF_I960RX:
+   case AAC_HWIF_NARK:
+   fwprintf(sc, HBA_FLAGS_DBG_INIT_B,
+   "set hardware up for i960Rx/NARK");
+   sc->aac_if = &aac_rx_interface;
+   break;
+   case AAC_HWIF_STRONGARM:
+   fwprintf(sc, HBA_FLAGS_DBG_INIT_B,
+   "set hardware up for StrongARM");
+   sc->aac_if = &aac_sa_interface;
+   break;
+   case AAC_HWIF_RKT:
+   fwprintf(sc, HBA_FLAGS_DBG_INIT_B,
+   "set hardware up for Rocket/MIPS");
+   sc->aac_if = &aac_rkt_interface;
+   break;
+   default:
+   sc->aac_hwif = AAC_HWIF_UNKNOWN;
+   device_printf(dev, "unknown hardware type\n");
+   goto out;
+   }
+
+   /* Set up quirks */
+   sc->flags = id->quirks;
+
+   /*
 * Allocate the PCI register window(s).
 */
rid = PCIR_BAR(0);
@@ -395,8 +426,8 @@ aac_pci_attach(device_t dev)
 */
rid = 0;
count = 0;
-   if (aac_enable_msi != 0 && pci_find_cap(dev, PCIY_MSI, ®) == 0) {
-   count = pci_msi_count(dev);
+   if (aac_enable_msi != 0 && (sc->flags & AAC_FLAGS_NOMSI) == 0 &&
+   (count = pci_msi_count(dev)) != 0) {
if (count > 1)
count = 1;
else
@@ -431,36 +462,6 @@ aac_pci_attach(device_t dev)
}
 
/*
-* Detect the hardware interface version, set up the bus interface
-* indirection.
-*/
-   id = aac_find_ident(dev);
-   sc->aac_hwif = id->hwif;
-   switch(sc->aac_hwif) {
-   case AAC_HWIF_I960RX:
-   case AAC_HWIF_NARK:
-   fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for 
i96

svn commit: r254155 - head/sys/boot/ficl

2013-08-09 Thread Marcel Moolenaar
Author: marcel
Date: Fri Aug  9 19:10:56 2013
New Revision: 254155
URL: http://svnweb.freebsd.org/changeset/base/254155

Log:
  Fix the freaddir implementation for the stand-alone interpreter.
  
  Bug pointed out by: Jan Beich 

Modified:
  head/sys/boot/ficl/loader.c

Modified: head/sys/boot/ficl/loader.c
==
--- head/sys/boot/ficl/loader.c Fri Aug  9 18:57:18 2013(r254154)
+++ head/sys/boot/ficl/loader.c Fri Aug  9 19:10:56 2013(r254155)
@@ -518,12 +518,12 @@ static void pfread(FICL_VM *pVM)
 static void pfreaddir(FICL_VM *pVM)
 {
 #ifdef TESTMAIN
-static union { 
-   struct dirent dirent;
-   char buf[512];
-} u;
-off_t off;
-int len;
+static struct dirent dirent;
+struct stat sb;
+char *buf;
+off_t off, ptr;
+u_int blksz;
+int bufsz;
 #endif
 struct dirent *d;
 int fd;
@@ -539,11 +539,39 @@ static void pfreaddir(FICL_VM *pVM)
  * We do the best we can to make freaddir work, but it's not at
  * all guaranteed.
  */
-off = lseek(fd, 0LL, SEEK_CUR);
-len = getdents(fd, u.buf, sizeof(u.buf));
-d = (len != -1) ? &u.dirent : NULL;
-if (d != NULL)
-   lseek(fd, off + d->d_reclen, SEEK_SET);
+d = NULL;
+buf = NULL;
+do {
+   if (fd == -1)
+   break;
+   if (fstat(fd, &sb) == -1)
+   break;
+   blksz = (sb.st_blksize) ? sb.st_blksize : getpagesize();
+   if ((blksz & (blksz - 1)) != 0)
+   break;
+   buf = malloc(blksz);
+   if (buf == NULL)
+   break;
+   off = lseek(fd, 0LL, SEEK_CUR);
+   if (off == -1)
+   break;
+   ptr = off;
+   if (lseek(fd, 0, SEEK_SET) == -1)
+   break;
+   bufsz = getdents(fd, buf, blksz);
+   while (bufsz > 0 && bufsz <= ptr) {
+   ptr -= bufsz;
+   bufsz = getdents(fd, buf, blksz);
+   }
+   if (bufsz <= 0)
+   break;
+   d = (void *)(buf + ptr);
+   dirent = *d;
+   off += d->d_reclen;
+   d = (lseek(fd, off, SEEK_SET) != off) ? NULL : &dirent;
+} while (0);
+if (buf != NULL)
+   free(buf);
 #else
 d = readdirfd(fd);
 #endif
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r253862 - head/sys/boot/ficl

2013-08-09 Thread Marcel Moolenaar

On Aug 4, 2013, at 9:52 PM, Jan Beich  wrote:
> 
>> 
>> It's probably not going to work on any other FS. The
>> alternative is to just not support freaddir due to lack
>> of runtime support.
> 
> What's the issue with my version in bin/172542 ? It doesn't
> use d_reclen but relies on a side-effect of readdir() call.

It leaks memory and doesn't handle the use of freaddir with
different fds interspersed. It's flawed in a different way.
FYI,

-- 
Marcel Moolenaar
mar...@xcllnt.net


___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r254157 - in stable/9: lib/libc/sparc64/gen lib/libthread_db/arch/sparc64 sys/sparc64/include sys/sparc64/sparc64

2013-08-09 Thread Marius Strobl
Author: marius
Date: Fri Aug  9 19:44:19 2013
New Revision: 254157
URL: http://svnweb.freebsd.org/changeset/base/254157

Log:
  MFC: r253266
  
  Prefix the alias macros for members of struct __mcontext with an underscore
  in order to avoid a clash in the net80211 code.

Modified:
  stable/9/lib/libc/sparc64/gen/makecontext.c
  stable/9/lib/libc/sparc64/gen/signalcontext.c
  stable/9/lib/libthread_db/arch/sparc64/libpthread_md.c
  stable/9/sys/sparc64/include/ucontext.h
  stable/9/sys/sparc64/sparc64/machdep.c
Directory Properties:
  stable/9/lib/libc/   (props changed)
  stable/9/lib/libthread_db/   (props changed)
  stable/9/sys/   (props changed)

Modified: stable/9/lib/libc/sparc64/gen/makecontext.c
==
--- stable/9/lib/libc/sparc64/gen/makecontext.c Fri Aug  9 19:20:46 2013
(r254156)
+++ stable/9/lib/libc/sparc64/gen/makecontext.c Fri Aug  9 19:44:19 2013
(r254157)
@@ -54,12 +54,12 @@ __makecontext(ucontext_t *ucp, void (*st
 
mc = &ucp->uc_mcontext;
if (ucp == NULL ||
-   (mc->mc_flags & ((1L << _MC_VERSION_BITS) - 1)) != _MC_VERSION)
+   (mc->_mc_flags & ((1L << _MC_VERSION_BITS) - 1)) != _MC_VERSION)
return;
if ((argc < 0) || (argc > 6) ||
(ucp->uc_stack.ss_sp == NULL) ||
(ucp->uc_stack.ss_size < MINSIGSTKSZ)) {
-   mc->mc_flags = 0;
+   mc->_mc_flags = 0;
return;
}
mc = &ucp->uc_mcontext;
@@ -71,8 +71,8 @@ __makecontext(ucontext_t *ucp, void (*st
mc->mc_global[1] = (uint64_t)start;
mc->mc_global[2] = (uint64_t)ucp;
mc->mc_out[6] = sp - SPOFF - sizeof(struct frame);
-   mc->mc_tnpc = (uint64_t)_ctx_start + 4;
-   mc->mc_tpc = (uint64_t)_ctx_start;
+   mc->_mc_tnpc = (uint64_t)_ctx_start + 4;
+   mc->_mc_tpc = (uint64_t)_ctx_start;
 }
 
 void
@@ -82,7 +82,7 @@ _ctx_done(ucontext_t *ucp)
if (ucp->uc_link == NULL)
exit(0);
else {
-   ucp->uc_mcontext.mc_flags = 0;
+   ucp->uc_mcontext._mc_flags = 0;
setcontext((const ucontext_t *)ucp->uc_link);
abort();
}

Modified: stable/9/lib/libc/sparc64/gen/signalcontext.c
==
--- stable/9/lib/libc/sparc64/gen/signalcontext.c   Fri Aug  9 19:20:46 
2013(r254156)
+++ stable/9/lib/libc/sparc64/gen/signalcontext.c   Fri Aug  9 19:44:19 
2013(r254157)
@@ -52,7 +52,7 @@ __signalcontext(ucontext_t *ucp, int sig
mcontext_t *mc;
 
mc = &ucp->uc_mcontext;
-   sfp = (struct sigframe *)(mc->mc_sp + SPOFF) - 1;
+   sfp = (struct sigframe *)(mc->_mc_sp + SPOFF) - 1;
fp = (struct frame *)sfp - 1;
 
bzero(fp, sizeof(*fp));
@@ -67,8 +67,8 @@ __signalcontext(ucontext_t *ucp, int sig
mc->mc_out[1] = (uint64_t)&sfp->sf_si;
mc->mc_out[2] = (uint64_t)&sfp->sf_uc;
mc->mc_out[6] = (uint64_t)fp - SPOFF;
-   mc->mc_tnpc = (uint64_t)_ctx_start + 4;
-   mc->mc_tpc = (uint64_t)_ctx_start;
+   mc->_mc_tnpc = (uint64_t)_ctx_start + 4;
+   mc->_mc_tpc = (uint64_t)_ctx_start;
 
ucp->uc_link = &sfp->sf_uc;
sigdelset(&ucp->uc_sigmask, sig);

Modified: stable/9/lib/libthread_db/arch/sparc64/libpthread_md.c
==
--- stable/9/lib/libthread_db/arch/sparc64/libpthread_md.c  Fri Aug  9 
19:20:46 2013(r254156)
+++ stable/9/lib/libthread_db/arch/sparc64/libpthread_md.c  Fri Aug  9 
19:44:19 2013(r254157)
@@ -57,9 +57,9 @@ pt_fpreg_to_ucontext(const struct fpreg*
 
memcpy(mc->mc_fp, r->fr_regs, MIN(sizeof(mc->mc_fp),
sizeof(r->fr_regs)));
-   mc->mc_fsr = r->fr_fsr;
-   mc->mc_gsr = r->fr_gsr;
-   mc->mc_fprs |= FPRS_FEF;
+   mc->_mc_fsr = r->fr_fsr;
+   mc->_mc_gsr = r->fr_gsr;
+   mc->_mc_fprs |= FPRS_FEF;
 }
 
 void
@@ -67,11 +67,11 @@ pt_ucontext_to_fpreg(const ucontext_t *u
 {
const mcontext_t *mc = &uc->uc_mcontext;
 
-   if ((mc->mc_fprs & FPRS_FEF) != 0) {
+   if ((mc->_mc_fprs & FPRS_FEF) != 0) {
memcpy(r->fr_regs, mc->mc_fp, MIN(sizeof(mc->mc_fp),
sizeof(r->fr_regs)));
-   r->fr_fsr = mc->mc_fsr;
-   r->fr_gsr = mc->mc_gsr;
+   r->fr_fsr = mc->_mc_fsr;
+   r->fr_gsr = mc->_mc_gsr;
} else
memset(r, 0, sizeof(*r));
 }

Modified: stable/9/sys/sparc64/include/ucontext.h
==
--- stable/9/sys/sparc64/include/ucontext.h Fri Aug  9 19:20:46 2013
(r254156)
+++ stable/9/sys/sparc64/include/ucontext.h Fri Aug  9 19:44:19 2013
(r254157)
@@ -6,7 +6,7 @@
  * modification, are permitted provided that the

svn commit: r254158 - stable/9/sys/fs/cd9660

2013-08-09 Thread Marius Strobl
Author: marius
Date: Fri Aug  9 19:45:55 2013
New Revision: 254158
URL: http://svnweb.freebsd.org/changeset/base/254158

Log:
  MFC: r253742
  
  - Add const-qualifiers to the arguments of isonum_*().
  - According to ISO 9660 7.1.2, isonum_712() should return a signed value.
  - Try to get isonum_*() closer to style(9).

Modified:
  stable/9/sys/fs/cd9660/iso.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/fs/   (props changed)

Modified: stable/9/sys/fs/cd9660/iso.h
==
--- stable/9/sys/fs/cd9660/iso.hFri Aug  9 19:44:19 2013
(r254157)
+++ stable/9/sys/fs/cd9660/iso.hFri Aug  9 19:45:55 2013
(r254158)
@@ -291,56 +291,65 @@ u_short sgetrune(const char *, size_t, c
  */
 
 static __inline uint8_t
-isonum_711(unsigned char *p)
+isonum_711(const unsigned char *p)
 {
-   return p[0];
+
+   return (p[0]);
 }
 
-static __inline uint8_t
-isonum_712(unsigned char *p)
+static __inline int8_t
+isonum_712(const unsigned char *p)
 {
-   return p[0];
+
+   return ((signed char)p[0]);
 }
 
 static __inline uint8_t
-isonum_713(unsigned char *p)
+isonum_713(const unsigned char *p)
 {
-   return p[0];
+
+   return (p[0]);
 }
 
 static __inline uint16_t
-isonum_721(unsigned char *p)
+isonum_721(const unsigned char *p)
 {
+
return (p[0] | p[1] << 8);
 }
 
 static __inline uint16_t
-isonum_722(unsigned char *p)
+isonum_722(const unsigned char *p)
 {
+
return (p[1] | p[0] << 8);
 }
 
 static __inline uint16_t
-isonum_723(unsigned char *p)
+isonum_723(const unsigned char *p)
 {
+
return (p[0] | p[1] << 8);
 }
 
 static __inline uint32_t
-isonum_731(unsigned char *p)
+isonum_731(const unsigned char *p)
 {
+
return (p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24);
 }
 
 static __inline uint32_t
-isonum_732(unsigned char *p)
+isonum_732(const unsigned char *p)
 {
+
return (p[3] | p[2] << 8 | p[1] << 16 | p[0] << 24);
 }
 
 static __inline uint32_t
-isonum_733(unsigned char *p)
+isonum_733(const unsigned char *p)
 {
+
return (p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24);
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r254150 - head/sys/vm

2013-08-09 Thread John Baldwin
On Friday, August 09, 2013 12:43:50 pm David E. O'Brien wrote:
> Author: obrien
> Date: Fri Aug  9 16:43:50 2013
> New Revision: 254150
> URL: http://svnweb.freebsd.org/changeset/base/254150
> 
> Log:
>   Add missing 'VPO_BUSY' from r254141 to fix kernel build break.
> 
> Modified:
>   head/sys/vm/vm_page.h

This can't possibly be correct as r254138 just removed this flag.  If it isn't 
obvious how to fix the uses added back in r254141, then r254141 should be 
reverted instead.

Hmm, looking at the relevant bits of r254141, it doesn't look obvious:

+   /* Detach the old page from the resident tailq. */
+   TAILQ_REMOVE(&object->memq, mold, listq);
+   vm_page_lock(mold);
+   if (mold->oflags & VPO_BUSY) {
+   mold->oflags &= ~VPO_BUSY;
+   vm_page_flash(mold);
+   }

Since nothing is setting this flag, this can't possibly work correctly 
currently.  I wouldn't boot a top-of-tree kernel right now. :(

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r254159 - head/tools/tools/usbtest

2013-08-09 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Aug  9 20:08:42 2013
New Revision: 254159
URL: http://svnweb.freebsd.org/changeset/base/254159

Log:
  Initial commit of my USB test code which can exercise connected USB
  devices and the FreeBSD USB stack itself. This program can be used to
  test compliance against well established usb.org standards, also
  called chapter-9 tests. The host platform can act as either USB device
  or USB host depending on the available hardware. The basic USB
  communication happens through FreeBSD's own libusb v2, and some
  sysctls are also used to invoke specific error conditions. This test
  program can be used to verify correct operation of external USB
  harddisks under heavy load and various other conditions. The software
  is driven via a simple command line interface. Main supported USB host
  classes are "USB mass storage" and "USB modems".

Added:
  head/tools/tools/usbtest/
  head/tools/tools/usbtest/Makefile   (contents, props changed)
  head/tools/tools/usbtest/usb_control_ep_test.c   (contents, props changed)
  head/tools/tools/usbtest/usb_modem_test.c   (contents, props changed)
  head/tools/tools/usbtest/usb_msc_test.c   (contents, props changed)
  head/tools/tools/usbtest/usb_msc_test.h   (contents, props changed)
  head/tools/tools/usbtest/usbtest.c   (contents, props changed)
  head/tools/tools/usbtest/usbtest.h   (contents, props changed)

Added: head/tools/tools/usbtest/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/tools/usbtest/Makefile   Fri Aug  9 20:08:42 2013
(r254159)
@@ -0,0 +1,40 @@
+#
+# $FreeBSD$
+#
+# Copyright (c) 2013 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+PROG=  usbtest
+MAN=
+SRCS+= usbtest.c
+SRCS+= usb_msc_test.c
+SRCS+= usb_modem_test.c
+SRCS+= usb_control_ep_test.c
+
+LDADD+=-lusb
+
+WARNS= 3
+
+CFLAGS+= -I ${.CURDIR}/../../../sys/dev/usb/gadget
+
+.include 

Added: head/tools/tools/usbtest/usb_control_ep_test.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/tools/usbtest/usb_control_ep_test.c  Fri Aug  9 20:08:42 
2013(r254159)
@@ -0,0 +1,673 @@
+/* $FreeBSD$ */
+/*-
+ * Copyright (c) 2007-2010 Hans Petter Selasky. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ 

Re: svn commit: r254150 - head/sys/vm

2013-08-09 Thread Alan Cox

On Aug 9, 2013, at 12:56 PM, John Baldwin wrote:

> On Friday, August 09, 2013 12:43:50 pm David E. O'Brien wrote:
>> Author: obrien
>> Date: Fri Aug  9 16:43:50 2013
>> New Revision: 254150
>> URL: http://svnweb.freebsd.org/changeset/base/254150
>> 
>> Log:
>>  Add missing 'VPO_BUSY' from r254141 to fix kernel build break.
>> 
>> Modified:
>>  head/sys/vm/vm_page.h
> 
> This can't possibly be correct as r254138 just removed this flag.  If it 
> isn't 
> obvious how to fix the uses added back in r254141, then r254141 should be 
> reverted instead.
> 
> Hmm, looking at the relevant bits of r254141, it doesn't look obvious:
> 
> +   /* Detach the old page from the resident tailq. */
> +   TAILQ_REMOVE(&object->memq, mold, listq);
> +   vm_page_lock(mold);

Replace the next four lines with

vm_page_xunbusy(mold);

> +   if (mold->oflags & VPO_BUSY) {
> +   mold->oflags &= ~VPO_BUSY;
> +   vm_page_flash(mold);
> +   }
> 
> Since nothing is setting this flag, this can't possibly work correctly 
> currently.  I wouldn't boot a top-of-tree kernel right now. :(
> 
> -- 
> John Baldwin
> 

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r254150 - head/sys/vm

2013-08-09 Thread John Baldwin
On Friday, August 09, 2013 4:34:36 pm Alan Cox wrote:
> 
> On Aug 9, 2013, at 12:56 PM, John Baldwin wrote:
> 
> > On Friday, August 09, 2013 12:43:50 pm David E. O'Brien wrote:
> >> Author: obrien
> >> Date: Fri Aug  9 16:43:50 2013
> >> New Revision: 254150
> >> URL: http://svnweb.freebsd.org/changeset/base/254150
> >> 
> >> Log:
> >>  Add missing 'VPO_BUSY' from r254141 to fix kernel build break.
> >> 
> >> Modified:
> >>  head/sys/vm/vm_page.h
> > 
> > This can't possibly be correct as r254138 just removed this flag.  If it 
isn't 
> > obvious how to fix the uses added back in r254141, then r254141 should be 
> > reverted instead.
> > 
> > Hmm, looking at the relevant bits of r254141, it doesn't look obvious:
> > 
> > +   /* Detach the old page from the resident tailq. */
> > +   TAILQ_REMOVE(&object->memq, mold, listq);
> > +   vm_page_lock(mold);
> 
> Replace the next four lines with
> 
>   vm_page_xunbusy(mold);

That is going to recurse on vm_page_lock(), is that ok?

> > +   if (mold->oflags & VPO_BUSY) {
> > +   mold->oflags &= ~VPO_BUSY;
> > +   vm_page_flash(mold);
> > +   }
> > 
> > Since nothing is setting this flag, this can't possibly work correctly 
> > currently.  I wouldn't boot a top-of-tree kernel right now. :(
> > 
> > -- 
> > John Baldwin
> > 
> 
> 

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r254150 - head/sys/vm

2013-08-09 Thread Alan Cox

On Aug 9, 2013, at 1:34 PM, Alan Cox wrote:

> 
> On Aug 9, 2013, at 12:56 PM, John Baldwin wrote:
> 
>> On Friday, August 09, 2013 12:43:50 pm David E. O'Brien wrote:
>>> Author: obrien
>>> Date: Fri Aug  9 16:43:50 2013
>>> New Revision: 254150
>>> URL: http://svnweb.freebsd.org/changeset/base/254150
>>> 
>>> Log:
>>> Add missing 'VPO_BUSY' from r254141 to fix kernel build break.
>>> 
>>> Modified:
>>> head/sys/vm/vm_page.h
>> 
>> This can't possibly be correct as r254138 just removed this flag.  If it 
>> isn't 
>> obvious how to fix the uses added back in r254141, then r254141 should be 
>> reverted instead.
>> 
>> Hmm, looking at the relevant bits of r254141, it doesn't look obvious:
>> 
>> +   /* Detach the old page from the resident tailq. */
>> +   TAILQ_REMOVE(&object->memq, mold, listq);
>> +   vm_page_lock(mold);
> 
> Replace the next four lines with
> 
>   vm_page_xunbusy(mold);
> 

On second thought, no, because it could lead to lock recursion.

>> +   if (mold->oflags & VPO_BUSY) {
>> +   mold->oflags &= ~VPO_BUSY;
>> +   vm_page_flash(mold);
>> +   }
>> 
>> Since nothing is setting this flag, this can't possibly work correctly 
>> currently.  I wouldn't boot a top-of-tree kernel right now. :(
>> 
>> -- 
>> John Baldwin
>> 
> 
> 

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r254150 - head/sys/vm

2013-08-09 Thread Alan Cox

On Aug 9, 2013, at 1:39 PM, John Baldwin wrote:

> On Friday, August 09, 2013 4:34:36 pm Alan Cox wrote:
>> 
>> On Aug 9, 2013, at 12:56 PM, John Baldwin wrote:
>> 
>>> On Friday, August 09, 2013 12:43:50 pm David E. O'Brien wrote:
 Author: obrien
 Date: Fri Aug  9 16:43:50 2013
 New Revision: 254150
 URL: http://svnweb.freebsd.org/changeset/base/254150
 
 Log:
 Add missing 'VPO_BUSY' from r254141 to fix kernel build break.
 
 Modified:
 head/sys/vm/vm_page.h
>>> 
>>> This can't possibly be correct as r254138 just removed this flag.  If it 
> isn't 
>>> obvious how to fix the uses added back in r254141, then r254141 should be 
>>> reverted instead.
>>> 
>>> Hmm, looking at the relevant bits of r254141, it doesn't look obvious:
>>> 
>>> +   /* Detach the old page from the resident tailq. */
>>> +   TAILQ_REMOVE(&object->memq, mold, listq);
>>> +   vm_page_lock(mold);
>> 
>> Replace the next four lines with
>> 
>>  vm_page_xunbusy(mold);
> 
> That is going to recurse on vm_page_lock(), is that ok?
> 


No, it's not.


>>> +   if (mold->oflags & VPO_BUSY) {
>>> +   mold->oflags &= ~VPO_BUSY;
>>> +   vm_page_flash(mold);
>>> +   }
>>> 
>>> Since nothing is setting this flag, this can't possibly work correctly 
>>> currently.  I wouldn't boot a top-of-tree kernel right now. :(
>>> 
>>> -- 
>>> John Baldwin
>>> 
>> 
>> 
> 
> -- 
> John Baldwin
> 

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r254150 - head/sys/vm

2013-08-09 Thread John Baldwin
On Friday, August 09, 2013 4:40:10 pm Alan Cox wrote:
> 
> On Aug 9, 2013, at 1:34 PM, Alan Cox wrote:
> 
> > 
> > On Aug 9, 2013, at 12:56 PM, John Baldwin wrote:
> > 
> >> On Friday, August 09, 2013 12:43:50 pm David E. O'Brien wrote:
> >>> Author: obrien
> >>> Date: Fri Aug  9 16:43:50 2013
> >>> New Revision: 254150
> >>> URL: http://svnweb.freebsd.org/changeset/base/254150
> >>> 
> >>> Log:
> >>> Add missing 'VPO_BUSY' from r254141 to fix kernel build break.
> >>> 
> >>> Modified:
> >>> head/sys/vm/vm_page.h
> >> 
> >> This can't possibly be correct as r254138 just removed this flag.  If it 
isn't 
> >> obvious how to fix the uses added back in r254141, then r254141 should be 
> >> reverted instead.
> >> 
> >> Hmm, looking at the relevant bits of r254141, it doesn't look obvious:
> >> 
> >> +   /* Detach the old page from the resident tailq. */
> >> +   TAILQ_REMOVE(&object->memq, mold, listq);
> >> +   vm_page_lock(mold);
> > 
> > Replace the next four lines with
> > 
> > vm_page_xunbusy(mold);
> > 
> 
> On second thought, no, because it could lead to lock recursion.

What about this.  I think this matches the common idiom I've seen in
other places.

Index: vm_page.c
===
--- vm_page.c   (revision 254158)
+++ vm_page.c   (working copy)
@@ -1202,12 +1202,9 @@
/* Detach the old page from the resident tailq. */
TAILQ_REMOVE(&object->memq, mold, listq);
vm_page_lock(mold);
-   if (mold->oflags & VPO_BUSY) {
-   mold->oflags &= ~VPO_BUSY;
-   vm_page_flash(mold);
-   }
mold->object = NULL;
vm_page_unlock(mold);
+   vm_page_xunbusy(mold);
 
/* Insert the new page in the resident tailq. */
if (mpred != NULL)


-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r254150 - head/sys/vm

2013-08-09 Thread Alan Cox

On Aug 9, 2013, at 1:45 PM, John Baldwin wrote:

> On Friday, August 09, 2013 4:40:10 pm Alan Cox wrote:
>> 
>> On Aug 9, 2013, at 1:34 PM, Alan Cox wrote:
>> 
>>> 
>>> On Aug 9, 2013, at 12:56 PM, John Baldwin wrote:
>>> 
 On Friday, August 09, 2013 12:43:50 pm David E. O'Brien wrote:
> Author: obrien
> Date: Fri Aug  9 16:43:50 2013
> New Revision: 254150
> URL: http://svnweb.freebsd.org/changeset/base/254150
> 
> Log:
> Add missing 'VPO_BUSY' from r254141 to fix kernel build break.
> 
> Modified:
> head/sys/vm/vm_page.h
 
 This can't possibly be correct as r254138 just removed this flag.  If it 
> isn't 
 obvious how to fix the uses added back in r254141, then r254141 should be 
 reverted instead.
 
 Hmm, looking at the relevant bits of r254141, it doesn't look obvious:
 
 +   /* Detach the old page from the resident tailq. */
 +   TAILQ_REMOVE(&object->memq, mold, listq);
 +   vm_page_lock(mold);
>>> 
>>> Replace the next four lines with
>>> 
>>> vm_page_xunbusy(mold);
>>> 
>> 
>> On second thought, no, because it could lead to lock recursion.
> 
> What about this.  I think this matches the common idiom I've seen in
> other places.
> 
> Index: vm_page.c
> ===
> --- vm_page.c   (revision 254158)
> +++ vm_page.c   (working copy)
> @@ -1202,12 +1202,9 @@
>/* Detach the old page from the resident tailq. */
>TAILQ_REMOVE(&object->memq, mold, listq);
>vm_page_lock(mold);
> -   if (mold->oflags & VPO_BUSY) {
> -   mold->oflags &= ~VPO_BUSY;
> -   vm_page_flash(mold);
> -   }
>mold->object = NULL;
>vm_page_unlock(mold);
> +   vm_page_xunbusy(mold);
> 
>/* Insert the new page in the resident tailq. */
>if (mpred != NULL)
> 
> 
> -- 

Index: vm/vm_page.c
===
--- vm/vm_page.c(revision 254146)
+++ vm/vm_page.c(working copy)
@@ -1174,6 +1174,8 @@ vm_page_prev(vm_page_t m)
 /*
  * Uses the page mnew as a replacement for an existing page at index
  * pindex which must be already present in the object.
+ *
+ * The existing page must not be on a paging queue.
  */
 vm_page_t
 vm_page_replace(vm_page_t mnew, vm_object_t object, vm_pindex_t pindex)
@@ -1198,16 +1200,14 @@ vm_page_replace(vm_page_t mnew, vm_object_t object
mnew->object = object;
mnew->pindex = pindex;
mold = vm_radix_replace(&object->rtree, mnew, pindex);
+   KASSERT(mold->queue == PQ_NONE,
+   ("vm_page_replace: mold is on a paging queue"));
 
/* Detach the old page from the resident tailq. */
TAILQ_REMOVE(&object->memq, mold, listq);
-   vm_page_lock(mold);
-   if (mold->oflags & VPO_BUSY) {
-   mold->oflags &= ~VPO_BUSY;
-   vm_page_flash(mold);
-   }
+
mold->object = NULL;
-   vm_page_unlock(mold);
+   vm_page_xunbusy(mold);
 
/* Insert the new page in the resident tailq. */
if (mpred != NULL)

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r254160 - stable/9/sys/dev/scc

2013-08-09 Thread Marius Strobl
Author: marius
Date: Fri Aug  9 20:58:06 2013
New Revision: 254160
URL: http://svnweb.freebsd.org/changeset/base/254160

Log:
  MFC: r253899, r253920
  
  - Implement iclear methods for QUICC and SAB 82532. With r253161 in place,
this is is crucial at least for the latter.
What happens is that attaching uart(4) to scc(4) causes the SAB 82532 to
"receive" something and trigger a SER_INT_RXREADY interrupt, given that
at least fast/filter interrupts are already enabled. Prior to r253161,
uart_bus_ihand() was set up at this point and handled that condition,
i. e. read the RX FIFO and issued a Receive Message Complete.
Now, uart_bus_ihand() and uart_intr() are setup after attaching uart(4),
leaving the SER_INT_RXREADY interrupt triggered during the latter to
be handled by the iclear method. However, with that method not implement,
this in turn causes SAB 82532 to not issue any further SER_INT_RXREADY
interrupts until the RX FIFO is full again. Thus, 15 received bytes go
to nowhere, given that "the other half" of the RX FIFO is used for status
information. Hence, implementing sab82532_bfe_iclear() fixes things again.
Potentially, the same problem exists for QUICC.
  - Remove unnecessary __RMAN_RESOURCE_VISIBLE.
  - Remove a superfluous header.
  - Use KOBJMETHOD_END.
  - Mark unused arguments as such.
  - Remove variables unused after initialization.
  
  Reviewed by:  marcel (earlier version)

Modified:
  stable/9/sys/dev/scc/scc_dev_quicc.c
  stable/9/sys/dev/scc/scc_dev_sab82532.c
  stable/9/sys/dev/scc/scc_dev_z8530.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/scc/scc_dev_quicc.c
==
--- stable/9/sys/dev/scc/scc_dev_quicc.cFri Aug  9 20:08:42 2013
(r254159)
+++ stable/9/sys/dev/scc/scc_dev_quicc.cFri Aug  9 20:58:06 2013
(r254160)
@@ -27,13 +27,10 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#define __RMAN_RESOURCE_VISIBLE
-
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -47,9 +44,13 @@ __FBSDID("$FreeBSD$");
 
 #definequicc_read2(bas, reg)   \
bus_space_read_2((bas)->bst, (bas)->bsh, reg)
+#definequicc_read4(bas, reg)   \
+   bus_space_read_4((bas)->bst, (bas)->bsh, reg)
 
 #definequicc_write2(bas, reg, val) \
bus_space_write_2((bas)->bst, (bas)->bsh, reg, val)
+#definequicc_write4(bas, reg, val) \
+   bus_space_write_4((bas)->bst, (bas)->bsh, reg, val)
 
 static int quicc_bfe_attach(struct scc_softc *, int);
 static int quicc_bfe_enabled(struct scc_softc *, struct scc_chan *);
@@ -63,7 +64,7 @@ static kobj_method_t quicc_methods[] = {
KOBJMETHOD(scc_iclear,  quicc_bfe_iclear),
KOBJMETHOD(scc_ipend,   quicc_bfe_ipend),
KOBJMETHOD(scc_probe,   quicc_bfe_probe),
-   { 0, 0 }
+   KOBJMETHOD_END
 };
 
 struct scc_class scc_quicc_class = {
@@ -77,11 +78,9 @@ struct scc_class scc_quicc_class = {
 };
 
 static int
-quicc_bfe_attach(struct scc_softc *sc, int reset)
+quicc_bfe_attach(struct scc_softc *sc __unused, int reset __unused)
 {
-   struct scc_bas *bas;
 
-   bas = &sc->sc_bas;
return (0);
 }
 
@@ -104,7 +103,18 @@ quicc_bfe_enabled(struct scc_softc *sc, 
 static int
 quicc_bfe_iclear(struct scc_softc *sc, struct scc_chan *ch)
 {
+   struct scc_bas *bas;
+   uint16_t rb, st;
 
+   bas = &sc->sc_bas;
+   mtx_lock_spin(&sc->sc_hwmtx);
+   if (ch->ch_ipend & SER_INT_RXREADY) {
+   rb = quicc_read2(bas, QUICC_PRAM_SCC_RBASE(ch->ch_nr - 1));
+   st = quicc_read2(bas, rb);
+   (void)quicc_read4(bas, rb + 4);
+   quicc_write2(bas, rb, st | 0x9000);
+   }
+   mtx_unlock_spin(&sc->sc_hwmtx);
return (0);
 }
 
@@ -142,10 +152,8 @@ quicc_bfe_ipend(struct scc_softc *sc)
 }
 
 static int
-quicc_bfe_probe(struct scc_softc *sc)
+quicc_bfe_probe(struct scc_softc *sc __unused)
 {
-   struct scc_bas *bas;
 
-   bas = &sc->sc_bas;
return (0);
 }

Modified: stable/9/sys/dev/scc/scc_dev_sab82532.c
==
--- stable/9/sys/dev/scc/scc_dev_sab82532.c Fri Aug  9 20:08:42 2013
(r254159)
+++ stable/9/sys/dev/scc/scc_dev_sab82532.c Fri Aug  9 20:58:06 2013
(r254160)
@@ -52,7 +52,7 @@ static kobj_method_t sab82532_methods[] 
KOBJMETHOD(scc_iclear,  sab82532_bfe_iclear),
KOBJMETHOD(scc_ipend,   sab82532_bfe_ipend),
KOBJMETHOD(scc_probe,   sab82532_bfe_probe),
-   { 0, 0 }
+   KOBJMETHOD_END
 };
 
 struct scc_class scc_sab82532_class = {
@@ -66,18 +66,37 @@ struct scc_class scc_sab82532_class = {
 };
 
 static int
-sab82532_bfe_attach(struct scc_softc *sc, int reset)
+sab82532_bfe_attach(struct scc_softc *sc __unu

svn commit: r254161 - stable/9/sys/dev/scc

2013-08-09 Thread Marius Strobl
Author: marius
Date: Fri Aug  9 21:01:41 2013
New Revision: 254161
URL: http://svnweb.freebsd.org/changeset/base/254161

Log:
  MFC: r253900
  
  - Use NULL instead of 0 for pointers.
  - Remove unnecessary __RMAN_RESOURCE_VISIBLE.

Modified:
  stable/9/sys/dev/scc/scc_bfe_ebus.c
  stable/9/sys/dev/scc/scc_bfe_macio.c
  stable/9/sys/dev/scc/scc_bfe_quicc.c
  stable/9/sys/dev/scc/scc_bfe_sbus.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/scc/scc_bfe_ebus.c
==
--- stable/9/sys/dev/scc/scc_bfe_ebus.c Fri Aug  9 20:58:06 2013
(r254160)
+++ stable/9/sys/dev/scc/scc_bfe_ebus.c Fri Aug  9 21:01:41 2013
(r254161)
@@ -94,4 +94,4 @@ static driver_t scc_ebus_driver = {
sizeof(struct scc_softc),
 };
 
-DRIVER_MODULE(scc, ebus, scc_ebus_driver, scc_devclass, 0, 0);
+DRIVER_MODULE(scc, ebus, scc_ebus_driver, scc_devclass, NULL, NULL);

Modified: stable/9/sys/dev/scc/scc_bfe_macio.c
==
--- stable/9/sys/dev/scc/scc_bfe_macio.cFri Aug  9 20:58:06 2013
(r254160)
+++ stable/9/sys/dev/scc/scc_bfe_macio.cFri Aug  9 21:01:41 2013
(r254161)
@@ -90,4 +90,4 @@ static driver_t scc_macio_driver = {
sizeof(struct scc_softc),
 };
 
-DRIVER_MODULE(scc, macio, scc_macio_driver, scc_devclass, 0, 0);
+DRIVER_MODULE(scc, macio, scc_macio_driver, scc_devclass, NULL, NULL);

Modified: stable/9/sys/dev/scc/scc_bfe_quicc.c
==
--- stable/9/sys/dev/scc/scc_bfe_quicc.cFri Aug  9 20:58:06 2013
(r254160)
+++ stable/9/sys/dev/scc/scc_bfe_quicc.cFri Aug  9 21:01:41 2013
(r254161)
@@ -27,8 +27,6 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#define__RMAN_RESOURCE_VISIBLE
-
 #include 
 #include 
 #include 
@@ -98,4 +96,4 @@ static driver_t scc_quicc_driver = {
sizeof(struct scc_softc),
 };
 
-DRIVER_MODULE(scc, quicc, scc_quicc_driver, scc_devclass, 0, 0);
+DRIVER_MODULE(scc, quicc, scc_quicc_driver, scc_devclass, NULL, NULL);

Modified: stable/9/sys/dev/scc/scc_bfe_sbus.c
==
--- stable/9/sys/dev/scc/scc_bfe_sbus.c Fri Aug  9 20:58:06 2013
(r254160)
+++ stable/9/sys/dev/scc/scc_bfe_sbus.c Fri Aug  9 21:01:41 2013
(r254161)
@@ -90,5 +90,5 @@ static driver_t scc_sbus_driver = {
sizeof(struct scc_softc),
 };
 
-DRIVER_MODULE(scc, fhc, scc_sbus_driver, scc_devclass, 0, 0);
-DRIVER_MODULE(scc, sbus, scc_sbus_driver, scc_devclass, 0, 0);
+DRIVER_MODULE(scc, fhc, scc_sbus_driver, scc_devclass, NULL, NULL);
+DRIVER_MODULE(scc, sbus, scc_sbus_driver, scc_devclass, NULL, NULL);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r254162 - stable/9/sys/dev/scc

2013-08-09 Thread Marius Strobl
Author: marius
Date: Fri Aug  9 21:04:00 2013
New Revision: 254162
URL: http://svnweb.freebsd.org/changeset/base/254162

Log:
  MFC: r253902
  
  Const'ify scc_driver_name.

Modified:
  stable/9/sys/dev/scc/scc_bfe.h
  stable/9/sys/dev/scc/scc_core.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/scc/scc_bfe.h
==
--- stable/9/sys/dev/scc/scc_bfe.h  Fri Aug  9 21:01:41 2013
(r254161)
+++ stable/9/sys/dev/scc/scc_bfe.h  Fri Aug  9 21:04:00 2013
(r254162)
@@ -136,7 +136,7 @@ struct scc_softc {
 };
 
 extern devclass_t scc_devclass;
-extern char scc_driver_name[];
+extern const char scc_driver_name[];
 
 int scc_bfe_attach(device_t dev, u_int ipc);
 int scc_bfe_detach(device_t dev);

Modified: stable/9/sys/dev/scc/scc_core.c
==
--- stable/9/sys/dev/scc/scc_core.c Fri Aug  9 21:01:41 2013
(r254161)
+++ stable/9/sys/dev/scc/scc_core.c Fri Aug  9 21:04:00 2013
(r254162)
@@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$");
 #include "scc_if.h"
 
 devclass_t scc_devclass;
-char scc_driver_name[] = "scc";
+const char scc_driver_name[] = "scc";
 
 static MALLOC_DEFINE(M_SCC, "SCC", "SCC driver");
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r254150 - head/sys/vm

2013-08-09 Thread Adrian Chadd
... ?

Can we please back it all out and then re-test attilio's patch with
alan's fix, before committing it all again?

I kinda have a vested interest at ${WORK} to be able to test -10 HEAD
right now for all these performance investigations and fixes that need
to happen for us; having the VM change and break _right now_ is going
to actually cause us pain.

Thanks,



-adrian
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r254163 - head/sys/vm

2013-08-09 Thread John Baldwin
Author: jhb
Date: Fri Aug  9 21:14:55 2013
New Revision: 254163
URL: http://svnweb.freebsd.org/changeset/base/254163

Log:
  Revert the addition of VPO_BUSY and instead update vm_page_replace() to
  properly unbusy the page.
  
  Submitted by: alc

Modified:
  head/sys/vm/vm_page.c
  head/sys/vm/vm_page.h

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Fri Aug  9 21:04:00 2013(r254162)
+++ head/sys/vm/vm_page.c   Fri Aug  9 21:14:55 2013(r254163)
@@ -1174,6 +1174,8 @@ vm_page_prev(vm_page_t m)
 /*
  * Uses the page mnew as a replacement for an existing page at index
  * pindex which must be already present in the object.
+ *
+ * The existing page must not be on a paging queue.
  */
 vm_page_t
 vm_page_replace(vm_page_t mnew, vm_object_t object, vm_pindex_t pindex)
@@ -1198,16 +1200,14 @@ vm_page_replace(vm_page_t mnew, vm_objec
mnew->object = object;
mnew->pindex = pindex;
mold = vm_radix_replace(&object->rtree, mnew, pindex);
+   KASSERT(mold->queue == PQ_NONE,
+   ("vm_page_replace: mold is on a paging queue"));
 
/* Detach the old page from the resident tailq. */
TAILQ_REMOVE(&object->memq, mold, listq);
-   vm_page_lock(mold);
-   if (mold->oflags & VPO_BUSY) {
-   mold->oflags &= ~VPO_BUSY;
-   vm_page_flash(mold);
-   }
+
mold->object = NULL;
-   vm_page_unlock(mold);
+   vm_page_xunbusy(mold);
 
/* Insert the new page in the resident tailq. */
if (mpred != NULL)

Modified: head/sys/vm/vm_page.h
==
--- head/sys/vm/vm_page.h   Fri Aug  9 21:04:00 2013(r254162)
+++ head/sys/vm/vm_page.h   Fri Aug  9 21:14:55 2013(r254163)
@@ -171,7 +171,6 @@ struct vm_page {
 #defineVPO_UNMANAGED   0x04/* no PV management for page */
 #defineVPO_SWAPINPROG  0x08/* swap I/O in progress on page 
*/
 #defineVPO_NOSYNC  0x10/* do not collect for syncer */
-#defineVPO_BUSY0x20/* TBD */
 
 /*
  * Busy page implementation details.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r254150 - head/sys/vm

2013-08-09 Thread alc

Quoting Adrian Chadd :


... ?

Can we please back it all out and then re-test attilio's patch with
alan's fix, before committing it all again?



John is doing a sanity check on my patch.  He'll commit it shortly.   
So, I don't think that we need to go as far as backing anything out.



I kinda have a vested interest at ${WORK} to be able to test -10 HEAD
right now for all these performance investigations and fixes that need
to happen for us; having the VM change and break _right now_ is going
to actually cause us pain.

Thanks,



-adrian






___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r254150 - head/sys/vm

2013-08-09 Thread Peter Wemm
On Fri, Aug 9, 2013 at 2:13 PM, Adrian Chadd  wrote:
> ... ?
>
> Can we please back it all out and then re-test attilio's patch with
> alan's fix, before committing it all again?
>
> I kinda have a vested interest at ${WORK} to be able to test -10 HEAD
> right now for all these performance investigations and fixes that need
> to happen for us; having the VM change and break _right now_ is going
> to actually cause us pain.

The current state of HEAD also kinda rules out refreshing freebsd.org
machines this week too.

-- 
Peter Wemm - pe...@wemm.org; pe...@freebsd.org; pe...@yahoo-inc.com; KI6FJV
UTF-8: for when a ' just won\342\200\231t do.
 ZFS must be the bacon of file systems. "everything's better with ZFS"
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r254150 - head/sys/vm

2013-08-09 Thread Adrian Chadd
No, we should upgrade the cluster, watch it fail, and then let people
experience their own handiwork.

Sheesh. :(



-adrian


On 9 August 2013 14:19, Peter Wemm  wrote:
> On Fri, Aug 9, 2013 at 2:13 PM, Adrian Chadd  wrote:
>> ... ?
>>
>> Can we please back it all out and then re-test attilio's patch with
>> alan's fix, before committing it all again?
>>
>> I kinda have a vested interest at ${WORK} to be able to test -10 HEAD
>> right now for all these performance investigations and fixes that need
>> to happen for us; having the VM change and break _right now_ is going
>> to actually cause us pain.
>
> The current state of HEAD also kinda rules out refreshing freebsd.org
> machines this week too.
>
> --
> Peter Wemm - pe...@wemm.org; pe...@freebsd.org; pe...@yahoo-inc.com; KI6FJV
> UTF-8: for when a ' just won\342\200\231t do.
>  ZFS must be the bacon of file systems. "everything's better with 
> ZFS"
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r254150 - head/sys/vm

2013-08-09 Thread Scott Long
Yes, at least some of this stuff is coming to light because we're aggressively
tracking top-of-tree in both 9 and 10.  Which is good.  But highly annoying at
times.  But good in the long run.  It means that 9.2 won't suck, and 10.0 won't
suck.  =-)

Scott

On Aug 9, 2013, at 3:22 PM, Adrian Chadd  wrote:

> No, we should upgrade the cluster, watch it fail, and then let people
> experience their own handiwork.
> 
> Sheesh. :(
> 
> 
> 
> -adrian
> 
> 
> On 9 August 2013 14:19, Peter Wemm  wrote:
>> On Fri, Aug 9, 2013 at 2:13 PM, Adrian Chadd  wrote:
>>> ... ?
>>> 
>>> Can we please back it all out and then re-test attilio's patch with
>>> alan's fix, before committing it all again?
>>> 
>>> I kinda have a vested interest at ${WORK} to be able to test -10 HEAD
>>> right now for all these performance investigations and fixes that need
>>> to happen for us; having the VM change and break _right now_ is going
>>> to actually cause us pain.
>> 
>> The current state of HEAD also kinda rules out refreshing freebsd.org
>> machines this week too.
>> 
>> --
>> Peter Wemm - pe...@wemm.org; pe...@freebsd.org; pe...@yahoo-inc.com; KI6FJV
>> UTF-8: for when a ' just won\342\200\231t do.
>>  ZFS must be the bacon of file systems. "everything's better with 
>> ZFS"

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r254164 - head/sys/arm/include

2013-08-09 Thread Olivier Houchard
Author: cognet
Date: Fri Aug  9 21:53:02 2013
New Revision: 254164
URL: http://svnweb.freebsd.org/changeset/base/254164

Log:
  Make sure vm_kmem_size is aligned on a page boundary, since that's what vmem
  expects.

Modified:
  head/sys/arm/include/vmparam.h

Modified: head/sys/arm/include/vmparam.h
==
--- head/sys/arm/include/vmparam.h  Fri Aug  9 21:14:55 2013
(r254163)
+++ head/sys/arm/include/vmparam.h  Fri Aug  9 21:53:02 2013
(r254164)
@@ -165,8 +165,8 @@
  * Ceiling on the size of the kmem submap: 40% of the kernel map.
  */
 #ifndef VM_KMEM_SIZE_MAX
-#defineVM_KMEM_SIZE_MAX((vm_max_kernel_address - \
-VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5)
+#defineVM_KMEM_SIZE_MAX(((vm_max_kernel_address - \
+VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5) &~ PAGE_MASK)
 #endif
 
 #ifdef ARM_USE_SMALL_ALLOC
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r254165 - head/sys/arm/arm

2013-08-09 Thread Olivier Houchard
Author: cognet
Date: Fri Aug  9 21:56:28 2013
New Revision: 254165
URL: http://svnweb.freebsd.org/changeset/base/254165

Log:
  - The address lies in the bus space handle, not in the cookie
  - Use the right address when calling kva_free()

Modified:
  head/sys/arm/arm/bus_space_generic.c

Modified: head/sys/arm/arm/bus_space_generic.c
==
--- head/sys/arm/arm/bus_space_generic.cFri Aug  9 21:53:02 2013
(r254164)
+++ head/sys/arm/arm/bus_space_generic.cFri Aug  9 21:56:28 2013
(r254165)
@@ -104,21 +104,21 @@ generic_bs_alloc(void *t, bus_addr_t rst
 void
 generic_bs_unmap(void *t, bus_space_handle_t h, bus_size_t size)
 {
-   vm_offset_t va, endva;
+   vm_offset_t va, endva, origva;
 
-   if (pmap_devmap_find_va((vm_offset_t)t, size) != NULL) {
+   if (pmap_devmap_find_va((vm_offset_t)h, size) != NULL) {
/* Device was statically mapped; nothing to do. */
return;
}
 
-   endva = round_page((vm_offset_t)t + size);
-   va = trunc_page((vm_offset_t)t);
+   endva = round_page((vm_offset_t)h + size);
+   origva = va = trunc_page((vm_offset_t)h);
 
while (va < endva) {
pmap_kremove(va);
va += PAGE_SIZE;
}
-   kva_free(va, endva - va);
+   kva_free(origva, endva - origva);
 }
 
 void
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r254164 - head/sys/arm/include

2013-08-09 Thread Alan Cox

On Aug 9, 2013, at 2:53 PM, Olivier Houchard wrote:

> Author: cognet
> Date: Fri Aug  9 21:53:02 2013
> New Revision: 254164
> URL: http://svnweb.freebsd.org/changeset/base/254164
> 
> Log:
>  Make sure vm_kmem_size is aligned on a page boundary, since that's what vmem
>  expects.
> 
> Modified:
>  head/sys/arm/include/vmparam.h
> 
> Modified: head/sys/arm/include/vmparam.h
> ==
> --- head/sys/arm/include/vmparam.hFri Aug  9 21:14:55 2013
> (r254163)
> +++ head/sys/arm/include/vmparam.hFri Aug  9 21:53:02 2013
> (r254164)
> @@ -165,8 +165,8 @@
>  * Ceiling on the size of the kmem submap: 40% of the kernel map.
>  */
> #ifndef VM_KMEM_SIZE_MAX
> -#define  VM_KMEM_SIZE_MAX((vm_max_kernel_address - \
> -VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5)
> +#define  VM_KMEM_SIZE_MAX(((vm_max_kernel_address - \
> +VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5) &~ PAGE_MASK)
> #endif
> 
> #ifdef ARM_USE_SMALL_ALLOC
> 


I would suggest a different approach.  Add a round_page() to kmeminit() after 
the TUNABLE_ULONG_FETCH("vm.kmem_size", ...).  This alternate approach has two 
virtues.  First, it will also handle a /boot/loader.conf value that isn't page 
aligned.  Second, it will simultaneously address the same problem on other 
architectures.

Thanks,
Alan

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r254166 - in head/sys: arm/include kern

2013-08-09 Thread Olivier Houchard
Author: cognet
Date: Fri Aug  9 22:30:54 2013
New Revision: 254166
URL: http://svnweb.freebsd.org/changeset/base/254166

Log:
  Instead of just trying to do it for arm, make sure vm_kmem_size is properly
  aligned in kmeminit(), where it'll work for any arch.
  
  Suggested by: alc

Modified:
  head/sys/arm/include/vmparam.h
  head/sys/kern/kern_malloc.c

Modified: head/sys/arm/include/vmparam.h
==
--- head/sys/arm/include/vmparam.h  Fri Aug  9 21:56:28 2013
(r254165)
+++ head/sys/arm/include/vmparam.h  Fri Aug  9 22:30:54 2013
(r254166)
@@ -165,8 +165,8 @@
  * Ceiling on the size of the kmem submap: 40% of the kernel map.
  */
 #ifndef VM_KMEM_SIZE_MAX
-#defineVM_KMEM_SIZE_MAX(((vm_max_kernel_address - \
-VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5) &~ PAGE_MASK)
+#defineVM_KMEM_SIZE_MAX((vm_max_kernel_address - \
+VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5)
 #endif
 
 #ifdef ARM_USE_SMALL_ALLOC

Modified: head/sys/kern/kern_malloc.c
==
--- head/sys/kern/kern_malloc.c Fri Aug  9 21:56:28 2013(r254165)
+++ head/sys/kern/kern_malloc.c Fri Aug  9 22:30:54 2013(r254166)
@@ -740,6 +740,7 @@ kmeminit(void)
if (vm_kmem_size / 2 / PAGE_SIZE > mem_size)
vm_kmem_size = 2 * mem_size * PAGE_SIZE;
 
+   vm_kmem_size = round_page(vm_kmem_size);
 #ifdef DEBUG_MEMGUARD
tmp = memguard_fudge(vm_kmem_size, kernel_map);
 #else
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r254167 - in head/sys: kern sys

2013-08-09 Thread Olivier Houchard
Author: cognet
Date: Fri Aug  9 23:13:52 2013
New Revision: 254167
URL: http://svnweb.freebsd.org/changeset/base/254167

Log:
  Don't call sleepinit() from proc0_init(), make it a SYSINIT instead.
  vmem needs the sleepq locks to be initialized when free'ing kva, so we want it
  called as early as possible.

Modified:
  head/sys/kern/init_main.c
  head/sys/kern/kern_synch.c
  head/sys/sys/proc.h

Modified: head/sys/kern/init_main.c
==
--- head/sys/kern/init_main.c   Fri Aug  9 22:30:54 2013(r254166)
+++ head/sys/kern/init_main.c   Fri Aug  9 23:13:52 2013(r254167)
@@ -455,10 +455,6 @@ proc0_init(void *dummy __unused)
 * Add scheduler specific parts to proc, thread as needed.
 */
schedinit();/* scheduler gets its house in order */
-   /*
-* Initialize sleep queue hash table
-*/
-   sleepinit();
 
/*
 * Create process 0 (the swapper).

Modified: head/sys/kern/kern_synch.c
==
--- head/sys/kern/kern_synch.c  Fri Aug  9 22:30:54 2013(r254166)
+++ head/sys/kern/kern_synch.c  Fri Aug  9 23:13:52 2013(r254167)
@@ -121,8 +121,8 @@ SDT_PROBE_DEFINE(sched, , , schedctl_nop
 SDT_PROBE_DEFINE(sched, , , schedctl_preempt, schedctl-preempt);
 SDT_PROBE_DEFINE(sched, , , schedctl_yield, schedctl-yield);
 
-void
-sleepinit(void)
+static void
+sleepinit(void *unused)
 {
 
hogticks = (hz / 10) * 2;   /* Default only. */
@@ -130,6 +130,12 @@ sleepinit(void)
 }
 
 /*
+ * vmem tries to lock the sleepq mutexes when free'ing kva, so make sure
+ * it is available.
+ */
+SYSINIT(sleepinit, SI_SUB_KMEM, SI_ORDER_ANY, sleepinit, 0);
+
+/*
  * General sleep call.  Suspends the current thread until a wakeup is
  * performed on the specified identifier.  The thread will then be made
  * runnable with the specified priority.  Sleeps at most sbt units of time

Modified: head/sys/sys/proc.h
==
--- head/sys/sys/proc.h Fri Aug  9 22:30:54 2013(r254166)
+++ head/sys/sys/proc.h Fri Aug  9 23:13:52 2013(r254167)
@@ -892,7 +892,6 @@ int setrunnable(struct thread *);
 void   setsugid(struct proc *p);
 intshould_yield(void);
 intsigonstack(size_t sp);
-void   sleepinit(void);
 void   stopevent(struct proc *, u_int, u_int);
 struct thread *tdfind(lwpid_t, pid_t);
 void   threadinit(void);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r254025 - in head/sys: amd64/amd64 arm/arm arm/at91 arm/mv/armadaxp arm/s3c2xx0 arm/xscale/i80321 arm/xscale/i8134x arm/xscale/ixp425 cddl/compat/opensolaris/kern cddl/compat/opensolar

2013-08-09 Thread Olivier Houchard
On Fri, Aug 09, 2013 at 10:27:48AM +0200, Zbigniew Bodek wrote:
> 2013/8/8 Zbyszek Bodek 
> 
> > On 07.08.2013 20:55, Jeff Roberson wrote:
> > > On Wed, 7 Aug 2013, Zbyszek Bodek wrote:
> > >
> > >> On 07.08.2013 08:21, Jeff Roberson wrote:
> > >>> Author: jeff
> > >>> Date: Wed Aug  7 06:21:20 2013
> > >>> New Revision: 254025
> > >>> URL: http://svnweb.freebsd.org/changeset/base/254025
> > >>>
> > >>> Log:
> > >>>   Replace kernel virtual address space allocation with vmem.  This
> > >>> provides
> > >>>   transparent layering and better fragmentation.
> > >>>
> > >>>- Normalize functions that allocate memory to use kmem_*
> > >>>- Those that allocate address space are named kva_*
> > >>>- Those that operate on maps are named kmap_*
> > >>>- Implement recursive allocation handling for kmem_arena in vmem.
> > >>>
> > >>>   Reviewed by:alc
> > >>>   Tested by:pho
> > >>>   Sponsored by:EMC / Isilon Storage Division
> > >>>
> > >>
> > >> Hello Jeff,
> > >>
> > >> I'm having some trouble on my ARM platform staring from this commit.
> > >> Kernel panics on assertion very early. Please check out log below (as
> > >> you can see bt doesn't look helpful but assertion message is visible. I
> > >> can send you which functions are in bt if it is necessary).
> > >
> > > It would be very helpful to know which function is passing the unaligned
> > > value.  I will resolve this later today if you can get me that
> > information.
> > >
> > > Thanks,
> > > Jeff
> > >

Hi,

I think I fixed all the issues with vmem on arm, at least I can now boot my
board. Zbyszek, can you confirm it works for you too ?

Thanks !

Olivier
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r254168 - head/sys/vm

2013-08-09 Thread Andrey Zonov
Author: zont
Date: Fri Aug  9 23:47:43 2013
New Revision: 254168
URL: http://svnweb.freebsd.org/changeset/base/254168

Log:
  Remove unused definition for CTL_VM_NAMES.
  
  Suggested by: bde

Modified:
  head/sys/vm/vm_param.h

Modified: head/sys/vm/vm_param.h
==
--- head/sys/vm/vm_param.h  Fri Aug  9 23:13:52 2013(r254167)
+++ head/sys/vm/vm_param.h  Fri Aug  9 23:47:43 2013(r254168)
@@ -86,21 +86,6 @@
 #define VM_SWAPPING_ENABLED11  /* swapping enabled */
 #defineVM_MAXID12  /* number of valid vm ids */
 
-#define CTL_VM_NAMES { \
-   { 0, 0 }, \
-   { "vmtotal", CTLTYPE_STRUCT }, \
-   { "loadavg", CTLTYPE_STRUCT }, \
-   { "v_free_min", CTLTYPE_UINT }, \
-   { "v_free_target", CTLTYPE_UINT }, \
-   { "v_free_reserved", CTLTYPE_UINT }, \
-   { "v_inactive_target", CTLTYPE_UINT }, \
-   { "v_cache_min", CTLTYPE_UINT }, \
-   { "v_cache_max", CTLTYPE_UINT }, \
-   { "v_pageout_free_min", CTLTYPE_UINT}, \
-   { "obsolete_pageout_algorithm", CTLTYPE_INT}, \
-   { "swap_enabled", CTLTYPE_INT},\
-}
-
 /*
  * Structure for swap device statistics
  */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r254169 - in stable/9/sys: amd64/include gnu/fs/xfs/FreeBSD i386/include kern mips/include pc98/include sparc64/include sys x86/include

2013-08-09 Thread Marius Strobl
Author: marius
Date: Sat Aug 10 00:00:19 2013
New Revision: 254169
URL: http://svnweb.freebsd.org/changeset/base/254169

Log:
  MFC: r241374
  
  Add an unified macro to deny ability from the compiler to reorder
  instruction loads/stores at its will.
  The macro __compiler_membar() is currently supported for both gcc and
  clang, but kernel compilation will fail otherwise.
  
  Reviewed by:  bde, kib
  Discussed with:   dim, theraven

Modified:
  stable/9/sys/amd64/include/atomic.h
  stable/9/sys/gnu/fs/xfs/FreeBSD/xfs_compat.h
  stable/9/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd.h
  stable/9/sys/i386/include/atomic.h
  stable/9/sys/kern/kern_rmlock.c
  stable/9/sys/mips/include/cpufunc.h
  stable/9/sys/pc98/include/bus.h
  stable/9/sys/sparc64/include/atomic.h
  stable/9/sys/sys/cdefs.h
  stable/9/sys/x86/include/bus.h

Modified: stable/9/sys/amd64/include/atomic.h
==
--- stable/9/sys/amd64/include/atomic.h Fri Aug  9 23:47:43 2013
(r254168)
+++ stable/9/sys/amd64/include/atomic.h Sat Aug 10 00:00:19 2013
(r254169)
@@ -226,7 +226,7 @@ atomic_fetchadd_long(volatile u_long *p,
 static __inline void   \
 atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\
 {  \
-   __asm __volatile("" : : : "memory");\
+   __compiler_membar();\
*p = v; \
 }  \
 struct __hack
@@ -240,7 +240,7 @@ atomic_load_acq_##TYPE(volatile u_##TYPE
u_##TYPE tmp;   \
\
tmp = *p;   \
-   __asm __volatile("" : : : "memory");\
+   __compiler_membar();\
return (tmp);   \
 }  \
 struct __hack

Modified: stable/9/sys/gnu/fs/xfs/FreeBSD/xfs_compat.h
==
--- stable/9/sys/gnu/fs/xfs/FreeBSD/xfs_compat.hFri Aug  9 23:47:43 
2013(r254168)
+++ stable/9/sys/gnu/fs/xfs/FreeBSD/xfs_compat.hSat Aug 10 00:00:19 
2013(r254169)
@@ -129,10 +129,6 @@ typedef dev_t  os_dev_t;
 #definecopy_from_user(dst, src, len)   copyin((src), (dst), (len))
 #endif
 
-#ifndef barrier
-#definebarrier()   __asm__ __volatile__("": : :"memory")
-#endif
-
 /*
  * Map simple global vairables to FreeBSD kernel equivalents
  */

Modified: stable/9/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd.h
==
--- stable/9/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd.h   Fri Aug  9 23:47:43 
2013(r254168)
+++ stable/9/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd.h   Sat Aug 10 00:00:19 
2013(r254169)
@@ -162,7 +162,7 @@
  */
 #define EFSCORRUPTED990/* Filesystem is corrupted */
 
-#define SYNCHRONIZE()  barrier()
+#define SYNCHRONIZE()  __compiler_membar()
 #define __return_address __builtin_return_address(0)
 
 /*

Modified: stable/9/sys/i386/include/atomic.h
==
--- stable/9/sys/i386/include/atomic.h  Fri Aug  9 23:47:43 2013
(r254168)
+++ stable/9/sys/i386/include/atomic.h  Sat Aug 10 00:00:19 2013
(r254169)
@@ -296,7 +296,7 @@ atomic_fetchadd_int(volatile u_int *p, u
 static __inline void   \
 atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\
 {  \
-   __asm __volatile("" : : : "memory");\
+   __compiler_membar();\
*p = v; \
 }  \
 struct __hack
@@ -310,7 +310,7 @@ atomic_load_acq_##TYPE(volatile u_##TYPE
u_##TYPE tmp;   \
\
tmp = *p;   \
-   __asm __volatile("" : : : "memory");\
+   __compiler_membar();\
return (tmp);   \
 }  \
 struct __hack

Modified: stable/9/sys/kern/kern_rmlock.c
==
--- stable/9/sys/kern/kern_rmlock.c Fri Aug  9 23:47:43 2013
(r254168)
+++ stable/9/sys/kern/kern_rmlock.c Sat Aug 10 00:00:19 2013
(r254169)
@@ -65,10 +65,6 @@ __FBSDID("$FreeBSD$");
  * does not seem very useful
  */
 
-static __inline void compiler_memory_barrier(void) {
-   __a

svn commit: r254170 - in stable/9/sys/sparc64: include sparc64

2013-08-09 Thread Marius Strobl
Author: marius
Date: Sat Aug 10 00:06:56 2013
New Revision: 254170
URL: http://svnweb.freebsd.org/changeset/base/254170

Log:
  MFC: r251782, r251783, r253994
  
  - Remove conflicting macros from SPARC64's atomic(9) header.
  - Add MD (for now) atomic_store_acq_() and use it in pmap_activate()
to get the semantics when setting the PMAP right.

Modified:
  stable/9/sys/sparc64/include/atomic.h
  stable/9/sys/sparc64/sparc64/pmap.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/sparc64/include/atomic.h
==
--- stable/9/sys/sparc64/include/atomic.h   Sat Aug 10 00:00:19 2013
(r254169)
+++ stable/9/sys/sparc64/include/atomic.h   Sat Aug 10 00:06:56 2013
(r254170)
@@ -133,17 +133,14 @@
t;  \
 })
 
-#defineatomic_load(p, sz)  
\
-   atomic_cas((p), 0, 0, sz)
-
-#defineatomic_load_acq(p, sz) ({   
\
+#defineatomic_ld_acq(p, sz) ({ 
\
itype(sz) v;\
-   v = atomic_load((p), sz);   \
+   v = atomic_cas((p), 0, 0, sz);  \
__compiler_membar();\
v;  \
 })
 
-#defineatomic_load_clear(p, sz) ({ 
\
+#defineatomic_ld_clear(p, sz) ({   
\
itype(sz) e, r; \
for (e = *(volatile itype(sz) *)(p);; e = r) {  \
r = atomic_cas((p), e, 0, sz);  \
@@ -153,7 +150,7 @@
e;  \
 })
 
-#defineatomic_store(p, v, sz) do { 
\
+#defineatomic_st(p, v, sz) do {
\
itype(sz) e, r; \
for (e = *(volatile itype(sz) *)(p);; e = r) {  \
r = atomic_cas((p), e, (v), sz);\
@@ -162,9 +159,14 @@
}   \
 } while (0)
 
-#defineatomic_store_rel(p, v, sz) do { 
\
+#defineatomic_st_acq(p, v, sz) do {
\
+   atomic_st((p), (v), sz);\
+   __compiler_membar();\
+} while (0)
+
+#defineatomic_st_rel(p, v, sz) do {
\
membar(LoadStore | StoreStore); \
-   atomic_store((p), (v), sz); \
+   atomic_st((p), (v), sz);\
 } while (0)
 
 #defineATOMIC_GEN(name, ptype, vtype, atype, sz)   
\
@@ -231,7 +233,7 @@ atomic_load_acq_ ## name(volatile ptype 
 static __inline vtype  \
 atomic_readandclear_ ## name(volatile ptype p) \
 {  \
-   return ((vtype)atomic_load_clear((p), sz)); \
+   return ((vtype)atomic_ld_clear((p), sz));   \
 }  \
\
 static __inline vtype  \
@@ -267,14 +269,14 @@ atomic_subtract_rel_ ## name(volatile pt
 }  \
\
 static __inline void   \
-atomic_store_ ## name(volatile ptype p, vtype v)   \
+atomic_store_acq_ ## name(volatile ptype p, vtype v)   \
 {  \
-   atomic_store((p), (v), sz); \
+   atomic_st_acq((p), (v), sz);\
 }  \
 static __inline void   \
 atomic_store_rel_ ## name(volatile ptype p, vtype v)   \
 {  \
-   atomic_store_rel((p), (v), sz); \
+   atomic_st_rel((p), (v), sz)

svn commit: r254171 - head/sys/arm/s3c2xx0

2013-08-09 Thread Olivier Houchard
Author: cognet
Date: Sat Aug 10 00:31:49 2013
New Revision: 254171
URL: http://svnweb.freebsd.org/changeset/base/254171

Log:
  - The address lies in the bus space handle, not in the cookie
  - Use the right address when calling kva_free()
  (Is there any reason why the s3c2xx0 comes with its own version of bs_map/
   bs_unmap ? It seems to be just the same as in bus_space_generic.c)

Modified:
  head/sys/arm/s3c2xx0/s3c2xx0_space.c

Modified: head/sys/arm/s3c2xx0/s3c2xx0_space.c
==
--- head/sys/arm/s3c2xx0/s3c2xx0_space.cSat Aug 10 00:06:56 2013
(r254170)
+++ head/sys/arm/s3c2xx0/s3c2xx0_space.cSat Aug 10 00:31:49 2013
(r254171)
@@ -200,21 +200,21 @@ s3c2xx0_bs_map(void *t, bus_addr_t bpa, 
 void
 s3c2xx0_bs_unmap(void *t, bus_space_handle_t h, bus_size_t size)
 {
-   vm_offset_t va, endva;
+   vm_offset_t va, endva, origva;
 
-   if (pmap_devmap_find_va((vm_offset_t)t, size) != NULL) {
+   if (pmap_devmap_find_va((vm_offset_t)h, size) != NULL) {
/* Device was statically mapped; nothing to do. */
return;
}
 
-   endva = round_page((vm_offset_t)t + size);
-   va = trunc_page((vm_offset_t)t);
+   endva = round_page((vm_offset_t)h + size);
+   origva = va = trunc_page((vm_offset_t)h);
 
while (va < endva) {
pmap_kremove(va);
va += PAGE_SIZE;
}
-   kva_free(va, endva - va);
+   kva_free(va, endva - origva);
 }
 
 int
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r254150 - head/sys/vm

2013-08-09 Thread Peter Wemm
On Fri, Aug 9, 2013 at 2:22 PM, Adrian Chadd  wrote:
> No, we should upgrade the cluster, watch it fail, and then let people
> experience their own handiwork.

It could turn out a bit like this:

http://devopsreactions.tumblr.com/post/57780524288/our-engineers-are-working-to-fix-the-problem-in-the

> Sheesh. :(
>
>
>
> -adrian
>
>
> On 9 August 2013 14:19, Peter Wemm  wrote:
>> On Fri, Aug 9, 2013 at 2:13 PM, Adrian Chadd  wrote:
>>> ... ?
>>>
>>> Can we please back it all out and then re-test attilio's patch with
>>> alan's fix, before committing it all again?
>>>
>>> I kinda have a vested interest at ${WORK} to be able to test -10 HEAD
>>> right now for all these performance investigations and fixes that need
>>> to happen for us; having the VM change and break _right now_ is going
>>> to actually cause us pain.
>>
>> The current state of HEAD also kinda rules out refreshing freebsd.org
>> machines this week too.
>>
>> --
>> Peter Wemm - pe...@wemm.org; pe...@freebsd.org; pe...@yahoo-inc.com; KI6FJV
>> UTF-8: for when a ' just won\342\200\231t do.
>>  ZFS must be the bacon of file systems. "everything's better with 
>> ZFS"



-- 
Peter Wemm - pe...@wemm.org; pe...@freebsd.org; pe...@yahoo-inc.com; KI6FJV
UTF-8: for when a ' just won\342\200\231t do.
 ZFS must be the bacon of file systems. "everything's better with ZFS"
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r254171 - head/sys/arm/s3c2xx0

2013-08-09 Thread Alan Cox

On Aug 9, 2013, at 5:31 PM, Olivier Houchard wrote:

> Author: cognet
> Date: Sat Aug 10 00:31:49 2013
> New Revision: 254171
> URL: http://svnweb.freebsd.org/changeset/base/254171
> 
> Log:
>  - The address lies in the bus space handle, not in the cookie
>  - Use the right address when calling kva_free()
>  (Is there any reason why the s3c2xx0 comes with its own version of bs_map/
>   bs_unmap ? It seems to be just the same as in bus_space_generic.c)
> 
> Modified:
>  head/sys/arm/s3c2xx0/s3c2xx0_space.c
> 
> Modified: head/sys/arm/s3c2xx0/s3c2xx0_space.c
> ==
> --- head/sys/arm/s3c2xx0/s3c2xx0_space.c  Sat Aug 10 00:06:56 2013
> (r254170)
> +++ head/sys/arm/s3c2xx0/s3c2xx0_space.c  Sat Aug 10 00:31:49 2013
> (r254171)
> @@ -200,21 +200,21 @@ s3c2xx0_bs_map(void *t, bus_addr_t bpa, 
> void
> s3c2xx0_bs_unmap(void *t, bus_space_handle_t h, bus_size_t size)
> {
> - vm_offset_t va, endva;
> + vm_offset_t va, endva, origva;
> 
> - if (pmap_devmap_find_va((vm_offset_t)t, size) != NULL) {
> + if (pmap_devmap_find_va((vm_offset_t)h, size) != NULL) {
>   /* Device was statically mapped; nothing to do. */
>   return;
>   }
> 
> - endva = round_page((vm_offset_t)t + size);
> - va = trunc_page((vm_offset_t)t);
> + endva = round_page((vm_offset_t)h + size);
> + origva = va = trunc_page((vm_offset_t)h);
> 
>   while (va < endva) {
>   pmap_kremove(va);
>   va += PAGE_SIZE;
>   }
> - kva_free(va, endva - va);
> + kva_free(va, endva - origva);

Shouldn't this be

kva_free(origva, endva - origva):

?

> }
> 
> int
> 

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r254171 - head/sys/arm/s3c2xx0

2013-08-09 Thread Olivier Houchard
On Fri, Aug 09, 2013 at 05:43:37PM -0700, Alan Cox wrote:
> 
> On Aug 9, 2013, at 5:31 PM, Olivier Houchard wrote:
> 
> > Author: cognet
> > Date: Sat Aug 10 00:31:49 2013
> > New Revision: 254171
> > URL: http://svnweb.freebsd.org/changeset/base/254171
> > 
> > Log:
> >  - The address lies in the bus space handle, not in the cookie
> >  - Use the right address when calling kva_free()
> >  (Is there any reason why the s3c2xx0 comes with its own version of bs_map/
> >   bs_unmap ? It seems to be just the same as in bus_space_generic.c)
> > 
> > Modified:
> >  head/sys/arm/s3c2xx0/s3c2xx0_space.c
> > 
> > Modified: head/sys/arm/s3c2xx0/s3c2xx0_space.c
> > ==
> > --- head/sys/arm/s3c2xx0/s3c2xx0_space.cSat Aug 10 00:06:56 2013
> > (r254170)
> > +++ head/sys/arm/s3c2xx0/s3c2xx0_space.cSat Aug 10 00:31:49 2013
> > (r254171)
> > @@ -200,21 +200,21 @@ s3c2xx0_bs_map(void *t, bus_addr_t bpa, 
> > void
> > s3c2xx0_bs_unmap(void *t, bus_space_handle_t h, bus_size_t size)
> > {
> > -   vm_offset_t va, endva;
> > +   vm_offset_t va, endva, origva;
> > 
> > -   if (pmap_devmap_find_va((vm_offset_t)t, size) != NULL) {
> > +   if (pmap_devmap_find_va((vm_offset_t)h, size) != NULL) {
> > /* Device was statically mapped; nothing to do. */
> > return;
> > }
> > 
> > -   endva = round_page((vm_offset_t)t + size);
> > -   va = trunc_page((vm_offset_t)t);
> > +   endva = round_page((vm_offset_t)h + size);
> > +   origva = va = trunc_page((vm_offset_t)h);
> > 
> > while (va < endva) {
> > pmap_kremove(va);
> > va += PAGE_SIZE;
> > }
> > -   kva_free(va, endva - va);
> > +   kva_free(va, endva - origva);
> 
> Shouldn't this be
> 
>   kva_free(origva, endva - origva):
> 
> ?
> 

Yes it should be, that's what I get for committing at almost 3am :)

Thanks a lot !

Olivier
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r254172 - head/sys/arm/s3c2xx0

2013-08-09 Thread Olivier Houchard
Author: cognet
Date: Sat Aug 10 00:53:22 2013
New Revision: 254172
URL: http://svnweb.freebsd.org/changeset/base/254172

Log:
  Use the correct address when calling kva_free()
  
  Pointy hat to:cognet
  Spotted out by:   alc

Modified:
  head/sys/arm/s3c2xx0/s3c2xx0_space.c

Modified: head/sys/arm/s3c2xx0/s3c2xx0_space.c
==
--- head/sys/arm/s3c2xx0/s3c2xx0_space.cSat Aug 10 00:31:49 2013
(r254171)
+++ head/sys/arm/s3c2xx0/s3c2xx0_space.cSat Aug 10 00:53:22 2013
(r254172)
@@ -214,7 +214,7 @@ s3c2xx0_bs_unmap(void *t, bus_space_hand
pmap_kremove(va);
va += PAGE_SIZE;
}
-   kva_free(va, endva - origva);
+   kva_free(origva, endva - origva);
 }
 
 int
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r254173 - head/usr.sbin/watchdogd

2013-08-09 Thread Alfred Perlstein
Author: alfred
Date: Sat Aug 10 01:48:15 2013
New Revision: 254173
URL: http://svnweb.freebsd.org/changeset/base/254173

Log:
  Fix bug in r253719: fix command line watchdog disable.
  
  r253719 disallowed watchdog(8) from disabling the watchdog
  by breaking the ability to pass 0 as a timeout arg.  Fix this.

Modified:
  head/usr.sbin/watchdogd/watchdogd.c

Modified: head/usr.sbin/watchdogd/watchdogd.c
==
--- head/usr.sbin/watchdogd/watchdogd.c Sat Aug 10 00:53:22 2013
(r254172)
+++ head/usr.sbin/watchdogd/watchdogd.c Sat Aug 10 01:48:15 2013
(r254173)
@@ -60,7 +60,8 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-static longfetchtimeout(int opt, const char *longopt, const char 
*myoptarg);
+static longfetchtimeout(int opt,
+const char *longopt, const char *myoptarg, int zero_ok);
 static voidparseargs(int, char *[]);
 static int seconds_to_pow2ns(int);
 static voidsighandler(int);
@@ -219,7 +220,7 @@ parse_timeout_to_pow2ns(char opt, const 
if (!longopt)
shortopt[1] = opt;
 
-   a = fetchtimeout(opt, longopt, myoptarg);
+   a = fetchtimeout(opt, longopt, myoptarg, 1);
 
if (a == 0)
rv = WD_TO_NEVER;
@@ -487,7 +488,7 @@ usage(void)
 }
 
 static long
-fetchtimeout(int opt, const char *longopt, const char *myoptarg)
+fetchtimeout(int opt, const char *longopt, const char *myoptarg, int zero_ok)
 {
const char *errstr;
char *p;
@@ -499,7 +500,7 @@ fetchtimeout(int opt, const char *longop
rv = strtol(myoptarg, &p, 0);
if ((p != NULL && *p != '\0') || errno != 0)
errstr = "is not a number";
-   if (rv <= 0)
+   if (rv < 0 || (!zero_ok && rv == 0))
errstr = "must be greater than zero";
if (errstr) {
if (longopt) 
@@ -721,7 +722,7 @@ parseargs(int argc, char *argv[])
break;
 #endif
case 's':
-   nap = fetchtimeout(c, NULL, optarg);
+   nap = fetchtimeout(c, NULL, optarg, 0);
break;
case 'S':
do_syslog = 0;
@@ -734,7 +735,8 @@ parseargs(int argc, char *argv[])
timeout);
break;
case 'T':
-   carp_thresh_seconds = fetchtimeout(c, "NULL", optarg);
+   carp_thresh_seconds =
+   fetchtimeout(c, "NULL", optarg, 0);
break;
case 'w':
do_timedog = 1;
@@ -742,7 +744,7 @@ parseargs(int argc, char *argv[])
case 0:
lopt = longopts[longindex].name;
if (!strcmp(lopt, "pretimeout")) {
-   pretimeout = fetchtimeout(0, lopt, optarg);
+   pretimeout = fetchtimeout(0, lopt, optarg, 0);
} else if (!strcmp(lopt, "pretimeout-action")) {
pretimeout_act = timeout_act_str2int(lopt,
optarg);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r254174 - head/share/man/man9

2013-08-09 Thread Joel Dahl
Author: joel (doc committer)
Date: Sat Aug 10 06:37:53 2013
New Revision: 254174
URL: http://svnweb.freebsd.org/changeset/base/254174

Log:
  mdoc: document title should be all caps.

Modified:
  head/share/man/man9/vm_page_busy.9

Modified: head/share/man/man9/vm_page_busy.9
==
--- head/share/man/man9/vm_page_busy.9  Sat Aug 10 01:48:15 2013
(r254173)
+++ head/share/man/man9/vm_page_busy.9  Sat Aug 10 06:37:53 2013
(r254174)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .Dd August 07, 2013
-.Dt vm_page_busy 9
+.Dt VM_PAGE_BUSY 9
 .Os
 .Sh NAME
 .Nm vm_page_busied ,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r254175 - head/share/man/man9

2013-08-09 Thread Joel Dahl
Author: joel (doc committer)
Date: Sat Aug 10 06:39:42 2013
New Revision: 254175
URL: http://svnweb.freebsd.org/changeset/base/254175

Log:
  Minor mdoc nits.

Modified:
  head/share/man/man9/mutex.9

Modified: head/share/man/man9/mutex.9
==
--- head/share/man/man9/mutex.9 Sat Aug 10 06:37:53 2013(r254174)
+++ head/share/man/man9/mutex.9 Sat Aug 10 06:39:42 2013(r254175)
@@ -226,7 +226,7 @@ lock, respectively, and also accept a
 .Fa flags
 argument.
 In both cases, the only flags presently available for lock acquires are
-.Dv MTX_QUIET 
+.Dv MTX_QUIET
 and
 .Dv MTX_RECURSE .
 If the
@@ -243,7 +243,6 @@ bit is turned on in the
 .Fa flags
 argument, then the mutex can be acquired recursively.
 .Pp
-.Pp
 The
 .Fn mtx_trylock
 attempts to acquire the
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r254176 - head/share/man/man4

2013-08-09 Thread Joel Dahl
Author: joel (doc committer)
Date: Sat Aug 10 06:48:20 2013
New Revision: 254176
URL: http://svnweb.freebsd.org/changeset/base/254176

Log:
  mdoc: remove commented out macro, sort SEE ALSO and add missing .El.

Modified:
  head/share/man/man4/rsu.4

Modified: head/share/man/man4/rsu.4
==
--- head/share/man/man4/rsu.4   Sat Aug 10 06:39:42 2013(r254175)
+++ head/share/man/man4/rsu.4   Sat Aug 10 06:48:20 2013(r254176)
@@ -22,7 +22,6 @@
 .Nm rsu
 .Nd Realtek RTL8188SU/RTL8192SU USB IEEE 802.11b/g/n wireless network device
 .Sh SYNOPSIS
-.\.Cd "rsu* at uhub? port ?"
 To compile this driver into the kernel,
 place the following lines in your kernel configuration file:
 .Bd -ragged -offset indent
@@ -120,6 +119,7 @@ The following adapters should work:
 .It Sweex LW154
 .It TRENDnet TEW-648UB
 .It TRENDnet TEW-649UB
+.El
 .Sh EXAMPLES
 Join an existing BSS network (i.e., connect to an access point):
 .Bd -literal -offset indent
@@ -149,14 +149,14 @@ The driver will reset the hardware.
 This should not happen.
 .El
 .Sh SEE ALSO
-.Xr arp 8 ,
+.Xr hostname 1 ,
 .Xr intro 1 ,
-.Xr netintro 4 ,
 .Xr usb 3 ,
-.Xr hostname 1 ,
-.Xr ifconfig 8,
+.Xr netintro 4 ,
+.Xr rsufw 4 ,
 .Xr wlan 4 ,
-.Xr rsufw 4
+.Xr arp 8 ,
+.Xr ifconfig 8
 .Sh HISTORY
 The
 .Nm
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"