svn commit: r281520 - in stable/10: sys/rpc usr.sbin/nfsd
Author: mav Date: Tue Apr 14 09:58:10 2015 New Revision: 281520 URL: https://svnweb.freebsd.org/changeset/base/281520 Log: MFC r281199: Remove hard limits on number of accepting NFS connections. Limits of 5 connections set long ago creates problems for SPEC benchmark. Make the NFS follow system-wide maximum. Modified: stable/10/sys/rpc/svc_generic.c stable/10/sys/rpc/svc_vc.c stable/10/usr.sbin/nfsd/nfsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/rpc/svc_generic.c == --- stable/10/sys/rpc/svc_generic.c Tue Apr 14 07:25:57 2015 (r281519) +++ stable/10/sys/rpc/svc_generic.c Tue Apr 14 09:58:10 2015 (r281520) @@ -168,7 +168,7 @@ svc_tp_create( taddr = uaddr2taddr(nconf, uaddr); bind.addr = *taddr; free(taddr, M_RPC); - bind.qlen = SOMAXCONN; + bind.qlen = -1; xprt = svc_tli_create(pool, NULL, nconf, bind, 0, 0); free(bind.addr.buf, M_RPC); } else { @@ -256,7 +256,7 @@ svc_tli_create( goto freedata; } } - solisten(so, SOMAXCONN, curthread); + solisten(so, -1, curthread); } else { if (bindresvport(so, (struct sockaddr *)bindaddr-addr.buf)) { Modified: stable/10/sys/rpc/svc_vc.c == --- stable/10/sys/rpc/svc_vc.c Tue Apr 14 07:25:57 2015(r281519) +++ stable/10/sys/rpc/svc_vc.c Tue Apr 14 09:58:10 2015(r281520) @@ -177,7 +177,7 @@ svc_vc_create(SVCPOOL *pool, struct sock xprt_register(xprt); - solisten(so, SOMAXCONN, curthread); + solisten(so, -1, curthread); SOCKBUF_LOCK(so-so_rcv); xprt-xp_upcallset = 1; Modified: stable/10/usr.sbin/nfsd/nfsd.c == --- stable/10/usr.sbin/nfsd/nfsd.c Tue Apr 14 07:25:57 2015 (r281519) +++ stable/10/usr.sbin/nfsd/nfsd.c Tue Apr 14 09:58:10 2015 (r281520) @@ -626,7 +626,7 @@ main(int argc, char **argv) bindhost[i]); nfsd_exit(1); } - if (listen(tcpsock, 5) 0) { + if (listen(tcpsock, -1) 0) { syslog(LOG_ERR, listen failed); nfsd_exit(1); } @@ -701,7 +701,7 @@ main(int argc, char **argv) bindhost[i]); nfsd_exit(1); } - if (listen(tcp6sock, 5) 0) { + if (listen(tcp6sock, -1) 0) { syslog(LOG_ERR, listen failed); nfsd_exit(1); } ___ svn-src-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to svn-src-stable-10-unsubscr...@freebsd.org
svn commit: r281535 - stable/10/usr.bin/sort
Author: pfg Date: Tue Apr 14 18:57:50 2015 New Revision: 281535 URL: https://svnweb.freebsd.org/changeset/base/281535 Log: MFC r281181, r281182; sort(1): Cleanups and a small memory leak. Remove custom getdelim(3) and fix a small memory leak. Obtained from: OpenBSD Modified: stable/10/usr.bin/sort/bwstring.c stable/10/usr.bin/sort/file.c stable/10/usr.bin/sort/file.h stable/10/usr.bin/sort/sort.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/sort/bwstring.c == --- stable/10/usr.bin/sort/bwstring.c Tue Apr 14 18:46:42 2015 (r281534) +++ stable/10/usr.bin/sort/bwstring.c Tue Apr 14 18:57:50 2015 (r281535) @@ -65,18 +65,12 @@ initialise_months(void) for (int i = 0; i 12; i++) { cmonths[i] = NULL; tmp = (unsigned char *) nl_langinfo(item[i]); - if (tmp == NULL) - continue; if (debug_sort) printf(month[%d]=%s\n, i, tmp); - len = strlen((char*)tmp); - if (len 1) + if (*tmp == '\0') continue; - while (isblank(*tmp)) - ++tmp; - m = sort_malloc(len + 1); - memcpy(m, tmp, len + 1); - m[len] = '\0'; + m = sort_strdup(tmp); + len = strlen(tmp); for (unsigned int j = 0; j len; j++) m[j] = toupper(m[j]); cmonths[i] = m; @@ -91,18 +85,17 @@ initialise_months(void) for (int i = 0; i 12; i++) { wmonths[i] = NULL; tmp = (unsigned char *) nl_langinfo(item[i]); - if (tmp == NULL) - continue; if (debug_sort) printf(month[%d]=%s\n, i, tmp); - len = strlen((char*)tmp); - if (len 1) + if (*tmp == '\0') continue; - while (isblank(*tmp)) - ++tmp; + len = strlen(tmp); m = sort_malloc(SIZEOF_WCHAR_STRING(len + 1)); - if (mbstowcs(m, (char*)tmp, len) == ((size_t) -1)) + if (mbstowcs(m, (char*)tmp, len) == + ((size_t) - 1)) { + sort_free(m); continue; + } m[len] = L'\0'; for (unsigned int j = 0; j len; j++) m[j] = towupper(m[j]); Modified: stable/10/usr.bin/sort/file.c == --- stable/10/usr.bin/sort/file.c Tue Apr 14 18:46:42 2015 (r281534) +++ stable/10/usr.bin/sort/file.c Tue Apr 14 18:57:50 2015 (r281535) @@ -188,42 +188,6 @@ file_is_tmp(const char* fn) } /* - * Read zero-terminated line from a file - */ -char * -read_file0_line(struct file0_reader *f0r) -{ - size_t pos = 0; - int c; - - if ((f0r-f == NULL) || feof(f0r-f)) - return (NULL); - - if (f0r-current_line f0r-current_sz 0) - f0r-current_line[0] = 0; - - while (!feof(f0r-f)) { - c = fgetc(f0r-f); - if (feof(f0r-f) || (c == -1)) - break; - if ((pos + 1) = f0r-current_sz) { - size_t newsz = (f0r-current_sz + 2) * 2; - f0r-current_line = sort_realloc(f0r-current_line, - newsz); - f0r-current_sz = newsz; - } - f0r-current_line[pos] = (char)c; - if (c == 0) - break; - else - f0r-current_line[pos + 1] = 0; - ++pos; - } - - return f0r-current_line; -} - -/* * Generate new temporary file name */ char * Modified: stable/10/usr.bin/sort/file.h == --- stable/10/usr.bin/sort/file.h Tue Apr 14 18:46:42 2015 (r281534) +++
svn commit: r281533 - stable/10/sbin/newfs_msdos
Author: pfg Date: Tue Apr 14 18:45:30 2015 New Revision: 281533 URL: https://svnweb.freebsd.org/changeset/base/281533 Log: MFC r281320: Update documented OEM string in newfs_msdos(8). This was updated in r203868 to better match the naming scheme in other OSs that use FAT. Modified: stable/10/sbin/newfs_msdos/newfs_msdos.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/newfs_msdos/newfs_msdos.8 == --- stable/10/sbin/newfs_msdos/newfs_msdos.8Tue Apr 14 18:13:55 2015 (r281532) +++ stable/10/sbin/newfs_msdos/newfs_msdos.8Tue Apr 14 18:45:30 2015 (r281533) @@ -25,7 +25,7 @@ .\ .\ $FreeBSD$ .\ -.Dd October 1, 2013 +.Dd April 9, 2015 .Dt NEWFS_MSDOS 8 .Os .Sh NAME @@ -112,7 +112,7 @@ only those characters permitted in regul .It Fl O Ar OEM OEM string (up to 8 characters). The default is -.Qq Li BSD 4.4 . +.Qq Li BSD4.4 . .It Fl S Ar sector-size Number of bytes per sector. Acceptable values are powers of 2 ___ svn-src-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to svn-src-stable-10-unsubscr...@freebsd.org
svn commit: r281538 - in stable: 10/sys/sys 9/sys/sys
Author: jhb Date: Tue Apr 14 20:05:26 2015 New Revision: 281538 URL: https://svnweb.freebsd.org/changeset/base/281538 Log: MFC 278474,278476,280279: Expand the bitcount*() API and use it to implement CPU_COUNT for cpusets. 278474: Use __builtin_popcnt() to implement a BIT_COUNT() operation for bitsets and use this to implement CPU_COUNT() to count the number of CPUs in a cpuset. 278476: Use __builtin_popcountl() instead of __builtin_popcount(). 280279: Expand the bitcount* API to support 64-bit integers, plain ints and longs and create a hidden API that can be used in other system headers without adding namespace pollution. - If the POPCNT instruction is enabled at compile time, use __builtin_popcount*() to implement __bitcount*(), otherwise fall back to software implementations. - Use the existing bitcount16() and bitcount32() from sys/systm.h to implement the non-POPCNT __bitcount16() and __bitcount32() in sys/types.h. - For the non-POPCNT __bitcount64(), use a similar SWAR method on 64-bit systems. For 32-bit systems, use two __bitcount32() operations on the two halves. - Use __bitcount32() to provide a __bitcount() that operates on plain ints. - Use either __bitcount32() or __bitcount64() to provide a __bitcountl() that operates on longs. - Add public bitcount*() wrappers for __bitcount*() for use in the kernel in sys/libkern.h. - Use __bitcountl() instead of __builtin_popcountl() in BIT_COUNT(). Modified: stable/10/sys/sys/bitset.h stable/10/sys/sys/cpuset.h stable/10/sys/sys/libkern.h stable/10/sys/sys/systm.h stable/10/sys/sys/types.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/sys/bitset.h stable/9/sys/sys/cpuset.h stable/9/sys/sys/libkern.h stable/9/sys/sys/systm.h stable/9/sys/sys/types.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/10/sys/sys/bitset.h == --- stable/10/sys/sys/bitset.h Tue Apr 14 19:18:34 2015(r281537) +++ stable/10/sys/sys/bitset.h Tue Apr 14 20:05:26 2015(r281538) @@ -176,4 +176,14 @@ __bit; \ }) +#defineBIT_COUNT(_s, p) __extension__ ({ \ + __size_t __i; \ + int __count;\ + \ + __count = 0;\ + for (__i = 0; __i __bitset_words((_s)); __i++)\ + __count += __bitcountl((p)-__bits[__i]); \ + __count;\ +}) + #endif /* !_SYS_BITSET_H_ */ Modified: stable/10/sys/sys/cpuset.h == --- stable/10/sys/sys/cpuset.h Tue Apr 14 19:18:34 2015(r281537) +++ stable/10/sys/sys/cpuset.h Tue Apr 14 20:05:26 2015(r281538) @@ -60,6 +60,7 @@ #defineCPU_OR_ATOMIC(d, s) BIT_OR_ATOMIC(CPU_SETSIZE, d, s) #defineCPU_COPY_STORE_REL(f, t)BIT_COPY_STORE_REL(CPU_SETSIZE, f, t) #defineCPU_FFS(p) BIT_FFS(CPU_SETSIZE, p) +#defineCPU_COUNT(p)BIT_COUNT(CPU_SETSIZE, p) /* * Valid cpulevel_t values. Modified: stable/10/sys/sys/libkern.h == --- stable/10/sys/sys/libkern.h Tue Apr 14 19:18:34 2015(r281537) +++ stable/10/sys/sys/libkern.h Tue Apr 14 20:05:26 2015(r281538) @@ -97,6 +97,11 @@ int flsl(long); #ifndefHAVE_INLINE_FLSLL int flsll(long long); #endif +#definebitcount64(x) __bitcount64((uint64_t)(x)) +#definebitcount32(x) __bitcount32((uint32_t)(x)) +#definebitcount16(x) __bitcount16((uint16_t)(x)) +#definebitcountl(x)__bitcountl((u_long)(x)) +#definebitcount(x) __bitcount((u_int)(x)) int fnmatch(const char *, const char *, int); int locc(int, char *, u_int); Modified: stable/10/sys/sys/systm.h == --- stable/10/sys/sys/systm.h Tue Apr 14 19:18:34 2015(r281537) +++ stable/10/sys/sys/systm.h Tue Apr 14 20:05:26 2015(r281538) @@ -424,33 +424,6 @@ int alloc_unr_specific(struct unrhdr *uh int alloc_unrl(struct unrhdr *uh); void free_unr(struct unrhdr *uh, u_int item); -/* - * Population count algorithm using SWAR approach - * - SIMD Within A Register. - */ -static __inline uint32_t -bitcount32(uint32_t x) -{ - - x = (x 0x) + ((x 0x)