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

2014-06-25 Thread Kevin Lo
Author: kevlo
Date: Wed Jun 25 07:29:40 2014
New Revision: 267853
URL: http://svnweb.freebsd.org/changeset/base/267853

Log:
  Add m_pulldown and m_unshare to MLINKS.

Modified:
  head/share/man/man9/Makefile

Modified: head/share/man/man9/Makefile
==
--- head/share/man/man9/MakefileWed Jun 25 05:39:30 2014
(r267852)
+++ head/share/man/man9/MakefileWed Jun 25 07:29:40 2014
(r267853)
@@ -918,10 +918,12 @@ MLINKS+=\
mbuf.9 m_move_pkthdr.9 \
mbuf.9 M_PREPEND.9 \
mbuf.9 m_prepend.9 \
+   mbuf.9 m_pulldown.9 \
mbuf.9 m_pullup.9 \
mbuf.9 m_split.9 \
mbuf.9 mtod.9 \
mbuf.9 M_TRAILINGSPACE.9 \
+   mbuf.9 m_unshare.9 \
mbuf.9 M_WRITABLE.9
 MLINKS+=\
mbuf_tags.9 m_tag_alloc.9 \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2014-06-25 Thread Konstantin Belousov
Author: kib
Date: Wed Jun 25 07:57:01 2014
New Revision: 267854
URL: http://svnweb.freebsd.org/changeset/base/267854

Log:
  Add fpu_kern.9 man page to the install.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/share/man/man9/Makefile

Modified: head/share/man/man9/Makefile
==
--- head/share/man/man9/MakefileWed Jun 25 07:29:40 2014
(r267853)
+++ head/share/man/man9/MakefileWed Jun 25 07:57:01 2014
(r267854)
@@ -112,6 +112,7 @@ MAN=accept_filter.9 \
fail.9 \
fetch.9 \
firmware.9 \
+   fpu_kern.9 \
g_access.9 \
g_attach.9 \
g_bio.9 \
@@ -670,6 +671,12 @@ MLINKS+=fetch.9 fubyte.9 \
fetch.9 fuword16.9 \
fetch.9 fuword32.9 \
fetch.9 fuword64.9
+MLINKS+=fpu_kern.9 fpu_kern_alloc_ctx.9 \
+   fpu_kern.9 fpu_kern_free_ctx.9 \
+   fpu_kern.9 fpu_kern_enter.9 \
+   fpu_kern.9 fpu_kern_leave.9 \
+   fpu_kern.9 fpu_kern_thread.9 \
+   fpu_kern.9 is_fpu_kern_thread.9
 MLINKS+=g_attach.9 g_detach.9
 MLINKS+=g_bio.9 g_clone_bio.9 \
g_bio.9 g_destroy_bio.9 \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon

2014-06-25 Thread Roger Pau Monné
Author: royger
Date: Wed Jun 25 09:51:08 2014
New Revision: 267858
URL: http://svnweb.freebsd.org/changeset/base/267858

Log:
  xen/virtio: fix balloon drivers to not mark pages as WIRED
  
  Prevent the Xen and VirtIO balloon drivers from marking pages as
  wired. This prevents them from increasing the system wired page count,
  which can lead to mlock failing because of hitting the limit in
  vm.max_wired.
  
  In the Xen case make sure pages are zeroed before giving them back to
  the hypervisor, or else we might be leaking data. Also remove the
  balloon_{append/retrieve} and link pages directly into the
  ballooned_pages queue using the plinks.q field in the page struct.
  
  Sponsored by: Citrix Systems R&D
  Reviewed by: kib, bryanv
  Approved by: gibbs
  
  dev/virtio/balloon/virtio_balloon.c:
   - Don't allocate pages with VM_ALLOC_WIRED.
  
  dev/xen/balloon/balloon.c:
   - Don't allocate pages with VM_ALLOC_WIRED.
   - Make sure pages are zeroed before giving them back to the
 hypervisor.
   - Remove the balloon_entry struct and the balloon_{append/retrieve}
 functions and use the page plinks.q entry to link the pages
 directly into the ballooned_pages queue.

Modified:
  head/sys/dev/virtio/balloon/virtio_balloon.c
  head/sys/dev/xen/balloon/balloon.c

Modified: head/sys/dev/virtio/balloon/virtio_balloon.c
==
--- head/sys/dev/virtio/balloon/virtio_balloon.cWed Jun 25 08:55:20 
2014(r267857)
+++ head/sys/dev/virtio/balloon/virtio_balloon.cWed Jun 25 09:51:08 
2014(r267858)
@@ -438,8 +438,7 @@ vtballoon_alloc_page(struct vtballoon_so
 {
vm_page_t m;
 
-   m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_WIRED |
-   VM_ALLOC_NOOBJ);
+   m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ);
if (m != NULL)
sc->vtballoon_current_npages++;
 
@@ -450,7 +449,6 @@ static void
 vtballoon_free_page(struct vtballoon_softc *sc, vm_page_t m)
 {
 
-   vm_page_unwire(m, PQ_INACTIVE);
vm_page_free(m);
sc->vtballoon_current_npages--;
 }

Modified: head/sys/dev/xen/balloon/balloon.c
==
--- head/sys/dev/xen/balloon/balloon.c  Wed Jun 25 08:55:20 2014
(r267857)
+++ head/sys/dev/xen/balloon/balloon.c  Wed Jun 25 09:51:08 2014
(r267858)
@@ -94,13 +94,8 @@ SYSCTL_ULONG(_dev_xen_balloon, OID_AUTO,
 SYSCTL_ULONG(_dev_xen_balloon, OID_AUTO, high_mem, CTLFLAG_RD,
 &bs.balloon_high, 0, "High-mem balloon");
 
-struct balloon_entry {
-   vm_page_t page;
-   STAILQ_ENTRY(balloon_entry) list;
-};
-
 /* List of ballooned pages, threaded through the mem_map array. */
-static STAILQ_HEAD(,balloon_entry) ballooned_pages;
+static TAILQ_HEAD(,vm_page) ballooned_pages;
 
 /* Main work function, always executed in process context. */
 static void balloon_process(void *unused);
@@ -110,47 +105,6 @@ static void balloon_process(void *unused
 #define WPRINTK(fmt, args...) \
printk(KERN_WARNING "xen_mem: " fmt, ##args)
 
-/* balloon_append: add the given page to the balloon. */
-static int
-balloon_append(vm_page_t page)
-{
-   struct balloon_entry *entry;
-
-   mtx_assert(&balloon_mutex, MA_OWNED);
-
-   entry = malloc(sizeof(struct balloon_entry), M_BALLOON, M_NOWAIT);
-   if (!entry)
-   return (ENOMEM);
-   entry->page = page;
-   STAILQ_INSERT_HEAD(&ballooned_pages, entry, list);
-   bs.balloon_low++;
-
-   return (0);
-}
-
-/* balloon_retrieve: rescue a page from the balloon, if it is not empty. */
-static vm_page_t
-balloon_retrieve(void)
-{
-   vm_page_t page;
-   struct balloon_entry *entry;
-
-   mtx_assert(&balloon_mutex, MA_OWNED);
-
-   if (STAILQ_EMPTY(&ballooned_pages))
-   return (NULL);
-
-   entry = STAILQ_FIRST(&ballooned_pages);
-   STAILQ_REMOVE_HEAD(&ballooned_pages, list);
-
-   page = entry->page;
-   free(entry, M_BALLOON);
-   
-   bs.balloon_low--;
-
-   return (page);
-}
-
 static unsigned long 
 current_target(void)
 {
@@ -203,7 +157,6 @@ static int 
 increase_reservation(unsigned long nr_pages)
 {
unsigned long  pfn, i;
-   struct balloon_entry *entry;
vm_page_t  page;
long   rc;
struct xen_memory_reservation reservation = {
@@ -217,10 +170,9 @@ increase_reservation(unsigned long nr_pa
if (nr_pages > nitems(frame_list))
nr_pages = nitems(frame_list);
 
-   for (entry = STAILQ_FIRST(&ballooned_pages), i = 0;
-i < nr_pages; i++, entry = STAILQ_NEXT(entry, list)) {
-   KASSERT(entry, ("ballooned_pages list corrupt"));
-   page = entry->page;
+   for (page = TAILQ_FIRST(&ballooned_pages), i = 0;
+   i < nr_pages; i++, page = TAILQ_NEXT(page, plinks.q)) {
+   KASSERT(page != NU

svn commit: r267859 - head

2014-06-25 Thread Baptiste Daroussin
Author: bapt
Date: Wed Jun 25 10:01:02 2014
New Revision: 267859
URL: http://svnweb.freebsd.org/changeset/base/267859

Log:
  Mark send-pr info page as an obsolete file

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Wed Jun 25 09:51:08 2014(r267858)
+++ head/ObsoleteFiles.inc  Wed Jun 25 10:01:02 2014(r267859)
@@ -39,6 +39,7 @@
 # done
 
 # 20140614: send-pr removal
+OLD_FILES+=usr/share/info/send-pr.info.gz
 OLD_FILES+=usr/share/man/man1/send-pr.1.gz
 OLD_FILES+=etc/gnats/freefall
 OLD_DIRS+=etc/gnats
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon

2014-06-25 Thread Attilio Rao
On Wed, Jun 25, 2014 at 11:51 AM, Roger Pau Monné  wrote:
> Author: royger
> Date: Wed Jun 25 09:51:08 2014
> New Revision: 267858
> URL: http://svnweb.freebsd.org/changeset/base/267858
>
> Log:
>   xen/virtio: fix balloon drivers to not mark pages as WIRED
>
>   Prevent the Xen and VirtIO balloon drivers from marking pages as
>   wired. This prevents them from increasing the system wired page count,
>   which can lead to mlock failing because of hitting the limit in
>   vm.max_wired.

This change is conceptually wrong.
The pages balloon is allocating are unmanaged and they should be wired
by definition. Alan and I are considering enforcing this (mandatory
wired pages for unmanaged pages allocation) directly in the KPI.
This in practice just seem an artifact to deal with scarce  wired
memory limit. I suggest that for the XEN case this limit gets bumped
rather relying on similar type of hacks.

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

svn commit: r267863 - in head: . usr.bin usr.bin/csup

2014-06-25 Thread Gavin Atkinson
Author: gavin
Date: Wed Jun 25 12:06:45 2014
New Revision: 267863
URL: http://svnweb.freebsd.org/changeset/base/267863

Log:
  Remove csup(1) and its associated cpasswd(1) tool.
  
  With the move by the FreeBSD Project away from CVSup as a distribution
  mechanism, there is no longer a need to keep this in base.
  
  Approved by:  mux (around a year ago), silence on -hackers
  X-MFC-after:  never

Deleted:
  head/usr.bin/csup/
Modified:
  head/ObsoleteFiles.inc
  head/usr.bin/Makefile

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Wed Jun 25 10:27:17 2014(r267862)
+++ head/ObsoleteFiles.inc  Wed Jun 25 12:06:45 2014(r267863)
@@ -38,6 +38,11 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20140625: csup removal
+OLD_FILES+=usr/bin/csup
+OLD_FILES+=usr/bin/cpasswd
+OLD_FILES+=usr/share/man/man1/csup.1.gz
+OLD_FILES+=usr/share/man/man1/cpasswd.1.gz
 # 20140614: send-pr removal
 OLD_FILES+=usr/share/info/send-pr.info.gz
 OLD_FILES+=usr/share/man/man1/send-pr.1.gz

Modified: head/usr.bin/Makefile
==
--- head/usr.bin/Makefile   Wed Jun 25 10:27:17 2014(r267862)
+++ head/usr.bin/Makefile   Wed Jun 25 12:06:45 2014(r267863)
@@ -266,10 +266,6 @@ SUBDIR+=   drill
 SUBDIR+=   host
 .endif
 
-.if ${MK_LIBTHR} != "no"
-SUBDIR+=   csup
-.endif
-
 .if ${MK_LOCATE} != "no"
 SUBDIR+=   locate
 .endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon

2014-06-25 Thread Gleb Smirnoff
On Wed, Jun 25, 2014 at 01:58:29PM +0200, Attilio Rao wrote:
A> > Log:
A> >   xen/virtio: fix balloon drivers to not mark pages as WIRED
A> >
A> >   Prevent the Xen and VirtIO balloon drivers from marking pages as
A> >   wired. This prevents them from increasing the system wired page count,
A> >   which can lead to mlock failing because of hitting the limit in
A> >   vm.max_wired.
A> 
A> This change is conceptually wrong.
A> The pages balloon is allocating are unmanaged and they should be wired
A> by definition. Alan and I are considering enforcing this (mandatory
A> wired pages for unmanaged pages allocation) directly in the KPI.
A> This in practice just seem an artifact to deal with scarce  wired
A> memory limit. I suggest that for the XEN case this limit gets bumped
A> rather relying on similar type of hacks.

Proper limit would be to count pages wired by userland via mlock(2)
and enforce limit only on those pages. Pages wired by kernel should
be either unlimited or controled by a separate limit.

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


svn commit: r267864 - head/release/scripts

2014-06-25 Thread Gavin Atkinson
Author: gavin
Date: Wed Jun 25 12:17:00 2014
New Revision: 267864
URL: http://svnweb.freebsd.org/changeset/base/267864

Log:
  Remove an nunnecessary reference to csup.

Modified:
  head/release/scripts/mm-mtree.sh

Modified: head/release/scripts/mm-mtree.sh
==
--- head/release/scripts/mm-mtree.shWed Jun 25 12:06:45 2014
(r267863)
+++ head/release/scripts/mm-mtree.shWed Jun 25 12:17:00 2014
(r267864)
@@ -5,7 +5,7 @@
 # This script is intended to be used as part of the release building
 # process to generate the /var/db/mergemaster.mtree file relevant to
 # the source tree used to create the release so that users can make
-# use of mergemaster's -U option to update their files after csup'ing
+# use of mergemaster's -U option to update their files after updating
 # to -stable.
 
 # Copyright 2009 Douglas Barton
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r267865 - head/share/examples/etc

2014-06-25 Thread Gavin Atkinson
Author: gavin
Date: Wed Jun 25 12:23:16 2014
New Revision: 267865
URL: http://svnweb.freebsd.org/changeset/base/267865

Log:
  Drop example variables for updating over csup.  These have not functioned
  since r251084.
  
  MFC after:1 week

Modified:
  head/share/examples/etc/make.conf

Modified: head/share/examples/etc/make.conf
==
--- head/share/examples/etc/make.conf   Wed Jun 25 12:17:00 2014
(r267864)
+++ head/share/examples/etc/make.conf   Wed Jun 25 12:23:16 2014
(r267865)
@@ -185,18 +185,6 @@
 #ENABLE_SUID_K5SU=
 #
 #
-# CVSup update flags.  Edit SUPFILE settings to reflect whichever distribution
-# file(s) you use on your site (see /usr/share/examples/cvsup/README for more
-# information on CVSup and these files).  To use, do "make update" in /usr/src.
-#
-#SUP_UPDATE=
-#
-#SUP=/usr/bin/csup
-#SUPFLAGS=   -L 2
-#SUPHOST=cvsup.uk.FreeBSD.org
-#SUPFILE=/usr/share/examples/cvsup/standard-supfile
-#PORTSSUPFILE=   /usr/share/examples/cvsup/ports-supfile
-#
 # top(1) uses a hash table for the user names.  The size of this hash
 # can be tuned to match the number of local users.  The table size should
 # be a prime number approximately twice as large as the number of lines in
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r267866 - head/share/man/man7

2014-06-25 Thread Gavin Atkinson
Author: gavin
Date: Wed Jun 25 12:28:22 2014
New Revision: 267866
URL: http://svnweb.freebsd.org/changeset/base/267866

Log:
  Drop references to updating over csup from build(7).
  
  MFC after:1 week

Modified:
  head/share/man/man7/build.7

Modified: head/share/man/man7/build.7
==
--- head/share/man/man7/build.7 Wed Jun 25 12:23:16 2014(r267865)
+++ head/share/man/man7/build.7 Wed Jun 25 12:28:22 2014(r267866)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 17, 2014
+.Dd June 25, 2014
 .Dt BUILD 7
 .Os
 .Sh NAME
@@ -40,8 +40,7 @@ normally
 and
 .Pa /usr/ports .
 These directories may be initially empty or non-existent until updated with
-.Xr csup 1 ,
-.Xr svn 1 ,
+.Xr svn 1
 or
 .Xr portsnap 8 .
 Directory
@@ -616,7 +615,6 @@ make TARGET=sparc64 DESTDIR=/clients/spa
 .Ed
 .Sh SEE ALSO
 .Xr cc 1 ,
-.Xr csup 1 ,
 .Xr install 1 ,
 .Xr make 1 ,
 .Xr svn 1 ,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r267867 - in head: . etc/mtree share/examples share/examples/cvsup

2014-06-25 Thread Gavin Atkinson
Author: gavin
Date: Wed Jun 25 12:32:41 2014
New Revision: 267867
URL: http://svnweb.freebsd.org/changeset/base/267867

Log:
  Remove example cvsup config files.
  
  MFC after:1 week

Deleted:
  head/share/examples/cvsup/
Modified:
  head/ObsoleteFiles.inc
  head/etc/mtree/BSD.usr.dist
  head/share/examples/Makefile

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Wed Jun 25 12:28:22 2014(r267866)
+++ head/ObsoleteFiles.inc  Wed Jun 25 12:32:41 2014(r267867)
@@ -43,6 +43,11 @@ OLD_FILES+=usr/bin/csup
 OLD_FILES+=usr/bin/cpasswd
 OLD_FILES+=usr/share/man/man1/csup.1.gz
 OLD_FILES+=usr/share/man/man1/cpasswd.1.gz
+OLD_FILES+=usr/share/examples/cvsup/README
+OLD_FILES+=usr/share/examples/cvsup/cvs-supfile
+OLD_FILES+=usr/share/examples/cvsup/stable-supfile
+OLD_FILES+=usr/share/examples/cvsup/standard-supfile
+OLD_DIRS+=usr/share/examples/cvsup
 # 20140614: send-pr removal
 OLD_FILES+=usr/share/info/send-pr.info.gz
 OLD_FILES+=usr/share/man/man1/send-pr.1.gz

Modified: head/etc/mtree/BSD.usr.dist
==
--- head/etc/mtree/BSD.usr.dist Wed Jun 25 12:28:22 2014(r267866)
+++ head/etc/mtree/BSD.usr.dist Wed Jun 25 12:32:41 2014(r267867)
@@ -301,8 +301,6 @@
 ..
 csh
 ..
-cvsup
-..
 diskless
 ..
 dma

Modified: head/share/examples/Makefile
==
--- head/share/examples/MakefileWed Jun 25 12:28:22 2014
(r267866)
+++ head/share/examples/MakefileWed Jun 25 12:32:41 2014
(r267867)
@@ -10,7 +10,6 @@ LDIRS=BSD_daemon \
bhyve \
bootforth \
csh \
-   cvsup \
diskless \
drivers \
etc \
@@ -52,10 +51,6 @@ XFILES=  BSD_daemon/FreeBSD.pfa \
bootforth/menuconf.4th \
bootforth/screen.4th \
csh/dot.cshrc \
-   cvsup/README \
-   cvsup/cvs-supfile \
-   cvsup/stable-supfile \
-   cvsup/standard-supfile \
diskless/ME \
diskless/README.BOOTP \
diskless/README.TEMPLATING \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon

2014-06-25 Thread Attilio Rao
On Wed, Jun 25, 2014 at 2:09 PM, Gleb Smirnoff  wrote:
> On Wed, Jun 25, 2014 at 01:58:29PM +0200, Attilio Rao wrote:
> A> > Log:
> A> >   xen/virtio: fix balloon drivers to not mark pages as WIRED
> A> >
> A> >   Prevent the Xen and VirtIO balloon drivers from marking pages as
> A> >   wired. This prevents them from increasing the system wired page count,
> A> >   which can lead to mlock failing because of hitting the limit in
> A> >   vm.max_wired.
> A>
> A> This change is conceptually wrong.
> A> The pages balloon is allocating are unmanaged and they should be wired
> A> by definition. Alan and I are considering enforcing this (mandatory
> A> wired pages for unmanaged pages allocation) directly in the KPI.
> A> This in practice just seem an artifact to deal with scarce  wired
> A> memory limit. I suggest that for the XEN case this limit gets bumped
> A> rather relying on similar type of hacks.
>
> Proper limit would be to count pages wired by userland via mlock(2)
> and enforce limit only on those pages. Pages wired by kernel should
> be either unlimited or controled by a separate limit.

FWIW, I mostly agree with this. I think that the kernel and userland
limits should be split apart. But for the time being, rising the limit
is better.

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon

2014-06-25 Thread Roger Pau Monné
On 25/06/14 13:58, Attilio Rao wrote:
> On Wed, Jun 25, 2014 at 11:51 AM, Roger Pau Monné  wrote:
>> Author: royger
>> Date: Wed Jun 25 09:51:08 2014
>> New Revision: 267858
>> URL: http://svnweb.freebsd.org/changeset/base/267858
>>
>> Log:
>>   xen/virtio: fix balloon drivers to not mark pages as WIRED
>>
>>   Prevent the Xen and VirtIO balloon drivers from marking pages as
>>   wired. This prevents them from increasing the system wired page count,
>>   which can lead to mlock failing because of hitting the limit in
>>   vm.max_wired.
> 
> This change is conceptually wrong.
> The pages balloon is allocating are unmanaged and they should be wired
> by definition. Alan and I are considering enforcing this (mandatory
> wired pages for unmanaged pages allocation) directly in the KPI.
> This in practice just seem an artifact to deal with scarce  wired
> memory limit. I suggest that for the XEN case this limit gets bumped
> rather relying on similar type of hacks.

IMHO, marking them as wired seems wrong too, those pages are not wired,
they are simply not there any more. This was discussed in:

http://lists.freebsd.org/pipermail/freebsd-virtualization/2014-June/002643.html

If there's consensus I will revert the change, but I would say that
increasing vm.max_wired for VMs is also a gross hack.

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

Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon

2014-06-25 Thread Attilio Rao
On Wed, Jun 25, 2014 at 3:29 PM, Roger Pau Monné  wrote:
> On 25/06/14 13:58, Attilio Rao wrote:
>> On Wed, Jun 25, 2014 at 11:51 AM, Roger Pau Monné  wrote:
>>> Author: royger
>>> Date: Wed Jun 25 09:51:08 2014
>>> New Revision: 267858
>>> URL: http://svnweb.freebsd.org/changeset/base/267858
>>>
>>> Log:
>>>   xen/virtio: fix balloon drivers to not mark pages as WIRED
>>>
>>>   Prevent the Xen and VirtIO balloon drivers from marking pages as
>>>   wired. This prevents them from increasing the system wired page count,
>>>   which can lead to mlock failing because of hitting the limit in
>>>   vm.max_wired.
>>
>> This change is conceptually wrong.
>> The pages balloon is allocating are unmanaged and they should be wired
>> by definition. Alan and I are considering enforcing this (mandatory
>> wired pages for unmanaged pages allocation) directly in the KPI.
>> This in practice just seem an artifact to deal with scarce  wired
>> memory limit. I suggest that for the XEN case this limit gets bumped
>> rather relying on similar type of hacks.
>
> IMHO, marking them as wired seems wrong too, those pages are not wired,
> they are simply not there any more. This was discussed in:

I'm not entirely sure what do you mean with "not there anymore", so
I'm just guessing and I assume that you mean "pages are not collected
in any vm object and then they are not referenced in any pagequeue".
By extension this also matches what "unmanaged page" means.

If the page is unmanaged it means that the pagedaemon won't see it, so
they won't be swapped out anyway. Wiring them it will enforce more
sanity checking on the page. The max_wired concern may be real,
however, please see below.

> http://lists.freebsd.org/pipermail/freebsd-virtualization/2014-June/002643.html
>
> If there's consensus I will revert the change, but I would say that
> increasing vm.max_wired for VMs is also a gross hack.

Why? If VM needs more wired memory I assume that we can tune up the
default value of max_wired?

I think that however your case makes an interesting point: if we want
to make unmanaged pages as inherently wired, we likely need a little
bit higher max_wired value. When I completed a patch for this, pho@
couldn't reproduce any similar issue even with stress-testing (and
also, the places to allocate unmanaged pages and not requesting
VM_ALLOC_WIRED were very little, almost 0, with the exception of
vm_page_alloc_contig() calls) but I think it is a valid proposition.

However I would still like to have more control on kernel-specific
wired memory for processes. I'm for example thinking to ARC vs. buffer
cache, where I expect the wired memory consumption to be much bigger
for the former case.

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon

2014-06-25 Thread Andriy Gapon
On 25/06/2014 17:44, Attilio Rao wrote:
> Why? If VM needs more wired memory I assume that we can tune up the
> default value of max_wired?
> 
> I think that however your case makes an interesting point: if we want
> to make unmanaged pages as inherently wired, we likely need a little
> bit higher max_wired value. When I completed a patch for this, pho@
> couldn't reproduce any similar issue even with stress-testing (and
> also, the places to allocate unmanaged pages and not requesting
> VM_ALLOC_WIRED were very little, almost 0, with the exception of
> vm_page_alloc_contig() calls) but I think it is a valid proposition.
> 
> However I would still like to have more control on kernel-specific
> wired memory for processes. I'm for example thinking to ARC vs. buffer
> cache, where I expect the wired memory consumption to be much bigger
> for the former case.

My humble opinion is that userland page wiring should be tuned via
resource limits and that vm.max_wired could be retired altogether.
Kernel wiring ignores the knob anyway.

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


Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon

2014-06-25 Thread Roger Pau Monné
On 25/06/14 15:44, Attilio Rao wrote:
> On Wed, Jun 25, 2014 at 3:29 PM, Roger Pau Monné  wrote:
>> On 25/06/14 13:58, Attilio Rao wrote:
>>> On Wed, Jun 25, 2014 at 11:51 AM, Roger Pau Monné  
>>> wrote:
 Author: royger
 Date: Wed Jun 25 09:51:08 2014
 New Revision: 267858
 URL: http://svnweb.freebsd.org/changeset/base/267858

 Log:
   xen/virtio: fix balloon drivers to not mark pages as WIRED

   Prevent the Xen and VirtIO balloon drivers from marking pages as
   wired. This prevents them from increasing the system wired page count,
   which can lead to mlock failing because of hitting the limit in
   vm.max_wired.
>>>
>>> This change is conceptually wrong.
>>> The pages balloon is allocating are unmanaged and they should be wired
>>> by definition. Alan and I are considering enforcing this (mandatory
>>> wired pages for unmanaged pages allocation) directly in the KPI.
>>> This in practice just seem an artifact to deal with scarce  wired
>>> memory limit. I suggest that for the XEN case this limit gets bumped
>>> rather relying on similar type of hacks.
>>
>> IMHO, marking them as wired seems wrong too, those pages are not wired,
>> they are simply not there any more. This was discussed in:
> 
> I'm not entirely sure what do you mean with "not there anymore", so
> I'm just guessing and I assume that you mean "pages are not collected
> in any vm object and then they are not referenced in any pagequeue".
> By extension this also matches what "unmanaged page" means.
> 
> If the page is unmanaged it means that the pagedaemon won't see it, so
> they won't be swapped out anyway. Wiring them it will enforce more
> sanity checking on the page. The max_wired concern may be real,
> however, please see below.

What I meant by "not there" is that the physical addresses associated
with the pages are no longer valid (it's a hole in the physical memory
map). To me it seems conceptually wrong to account those pages as wired.

Thinking from a user point of view for example, if I'm inside of a VM
that has ballooned down, I will see a huge amount of memory marked as
wired on the top utility, which seems wrong, those pages are simply not
there anymore, and as so, they shouldn't show up in stats.

It also makes it really hard to know which memory is really wired and in
use by the system, as opposed to the wired memory used by the balloon
driver.

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

svn commit: r267869 - in head/sys: cddl/contrib/opensolaris/uts/common/dtrace modules/dtrace/fasttrap

2014-06-25 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Jun 25 14:23:30 2014
New Revision: 267869
URL: http://svnweb.freebsd.org/changeset/base/267869

Log:
  MFV   r260708
  
  4427 pid provider rejects probes with valid UTF-8 names
  
  This make use of Solaris' u8_validate() which we happen to
  use since r185029 for ZFS.
  
  Illumos Revision: 1444d846b126463eb1059a572ff114d51f7562e5
  
  Reference:
  https://www.illumos.org/issues/4427
  
  Obtained from:Illumos
  MFC after:2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
  head/sys/modules/dtrace/fasttrap/Makefile

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c  Wed Jun 
25 13:33:31 2014(r267868)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c  Wed Jun 
25 14:23:30 2014(r267869)
@@ -28,9 +28,9 @@
  * Use is subject to license terms.
  */
 
-#if defined(sun)
-#pragma ident  "%Z%%M% %I% %E% SMI"
-#endif
+/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
 
 #include 
 #include 
@@ -63,6 +63,7 @@
 #if !defined(sun)
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2256,8 +2257,7 @@ fasttrap_ioctl(struct cdev *dev, u_long 
fasttrap_probe_spec_t *probe;
uint64_t noffs;
size_t size;
-   int ret;
-   char *c;
+   int ret, err;
 
if (copyin(&uprobe->ftps_noffs, &noffs,
sizeof (uprobe->ftps_noffs)))
@@ -2286,18 +2286,16 @@ fasttrap_ioctl(struct cdev *dev, u_long 
 * Verify that the function and module strings contain no
 * funny characters.
 */
-   for (c = &probe->ftps_func[0]; *c != '\0'; c++) {
-   if (*c < 0x20 || 0x7f <= *c) {
-   ret = EINVAL;
-   goto err;
-   }
+   if (u8_validate(probe->ftps_func, strlen(probe->ftps_func),
+   NULL, U8_VALIDATE_ENTIRE, &err) < 0) {
+   ret = EINVAL;
+   goto err;
}
 
-   for (c = &probe->ftps_mod[0]; *c != '\0'; c++) {
-   if (*c < 0x20 || 0x7f <= *c) {
-   ret = EINVAL;
-   goto err;
-   }
+   if (u8_validate(probe->ftps_mod, strlen(probe->ftps_mod),
+   NULL, U8_VALIDATE_ENTIRE, &err) < 0) {
+   ret = EINVAL;
+   goto err;
}
 
 #ifdef notyet

Modified: head/sys/modules/dtrace/fasttrap/Makefile
==
--- head/sys/modules/dtrace/fasttrap/Makefile   Wed Jun 25 13:33:31 2014
(r267868)
+++ head/sys/modules/dtrace/fasttrap/Makefile   Wed Jun 25 14:23:30 2014
(r267869)
@@ -8,6 +8,9 @@ KMOD=   fasttrap
 SRCS=  fasttrap.c fasttrap_isa.c opt_compat.h
 SRCS+= vnode_if.h
 
+.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/common/unicode
+SRCS+= u8_textprep.c
+
 CFLAGS+=   -I${SYSDIR}/cddl/compat/opensolaris \
-I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
-I${SYSDIR}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon

2014-06-25 Thread Attilio Rao
On Wed, Jun 25, 2014 at 4:06 PM, Roger Pau Monné  wrote:
> On 25/06/14 15:44, Attilio Rao wrote:
>> On Wed, Jun 25, 2014 at 3:29 PM, Roger Pau Monné  wrote:
>>> On 25/06/14 13:58, Attilio Rao wrote:
 On Wed, Jun 25, 2014 at 11:51 AM, Roger Pau Monné  
 wrote:
> Author: royger
> Date: Wed Jun 25 09:51:08 2014
> New Revision: 267858
> URL: http://svnweb.freebsd.org/changeset/base/267858
>
> Log:
>   xen/virtio: fix balloon drivers to not mark pages as WIRED
>
>   Prevent the Xen and VirtIO balloon drivers from marking pages as
>   wired. This prevents them from increasing the system wired page count,
>   which can lead to mlock failing because of hitting the limit in
>   vm.max_wired.

 This change is conceptually wrong.
 The pages balloon is allocating are unmanaged and they should be wired
 by definition. Alan and I are considering enforcing this (mandatory
 wired pages for unmanaged pages allocation) directly in the KPI.
 This in practice just seem an artifact to deal with scarce  wired
 memory limit. I suggest that for the XEN case this limit gets bumped
 rather relying on similar type of hacks.
>>>
>>> IMHO, marking them as wired seems wrong too, those pages are not wired,
>>> they are simply not there any more. This was discussed in:
>>
>> I'm not entirely sure what do you mean with "not there anymore", so
>> I'm just guessing and I assume that you mean "pages are not collected
>> in any vm object and then they are not referenced in any pagequeue".
>> By extension this also matches what "unmanaged page" means.
>>
>> If the page is unmanaged it means that the pagedaemon won't see it, so
>> they won't be swapped out anyway. Wiring them it will enforce more
>> sanity checking on the page. The max_wired concern may be real,
>> however, please see below.
>
> What I meant by "not there" is that the physical addresses associated
> with the pages are no longer valid (it's a hole in the physical memory
> map). To me it seems conceptually wrong to account those pages as wired.

They are not. They are at all effect wired (even if with a slightly
different semantic), meaning wired as also not-pageable. The fact that
you won't mark them wired will just weaken the accounting,
debuggability and tracing side.

> Thinking from a user point of view for example, if I'm inside of a VM
> that has ballooned down, I will see a huge amount of memory marked as
> wired on the top utility, which seems wrong, those pages are simply not
> there anymore, and as so, they shouldn't show up in stats.
>
> It also makes it really hard to know which memory is really wired and in
> use by the system, as opposed to the wired memory used by the balloon
> driver.

I think this is really the problem with your approach. Now memory will
not be reachable by the pagedaemon and yet you won't see it showing up
anywhere. Memory leaks could go unnoticed, to some extent. I don't
think that's really what you want.

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon

2014-06-25 Thread Alfred Perlstein

On 6/25/14 5:41 AM, Attilio Rao wrote:

On Wed, Jun 25, 2014 at 2:09 PM, Gleb Smirnoff  wrote:

On Wed, Jun 25, 2014 at 01:58:29PM +0200, Attilio Rao wrote:
A> > Log:
A> >   xen/virtio: fix balloon drivers to not mark pages as WIRED
A> >
A> >   Prevent the Xen and VirtIO balloon drivers from marking pages as
A> >   wired. This prevents them from increasing the system wired page count,
A> >   which can lead to mlock failing because of hitting the limit in
A> >   vm.max_wired.
A>
A> This change is conceptually wrong.
A> The pages balloon is allocating are unmanaged and they should be wired
A> by definition. Alan and I are considering enforcing this (mandatory
A> wired pages for unmanaged pages allocation) directly in the KPI.
A> This in practice just seem an artifact to deal with scarce  wired
A> memory limit. I suggest that for the XEN case this limit gets bumped
A> rather relying on similar type of hacks.

Proper limit would be to count pages wired by userland via mlock(2)
and enforce limit only on those pages. Pages wired by kernel should
be either unlimited or controled by a separate limit.

FWIW, I mostly agree with this. I think that the kernel and userland
limits should be split apart. But for the time being, rising the limit
is better.

Attilio


Can you explain?  I would think that if you were designing some kind of 
embedded device you would want to know exactly how much locked pages 
there are overall, not just in userland.


Meaning you would not want to overcommit and have too many locked pages 
due to kernel+user.


Perhaps that needs an API as well?
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon

2014-06-25 Thread Alfred Perlstein

On 6/25/14 6:49 AM, Andriy Gapon wrote:

On 25/06/2014 17:44, Attilio Rao wrote:

Why? If VM needs more wired memory I assume that we can tune up the
default value of max_wired?

I think that however your case makes an interesting point: if we want
to make unmanaged pages as inherently wired, we likely need a little
bit higher max_wired value. When I completed a patch for this, pho@
couldn't reproduce any similar issue even with stress-testing (and
also, the places to allocate unmanaged pages and not requesting
VM_ALLOC_WIRED were very little, almost 0, with the exception of
vm_page_alloc_contig() calls) but I think it is a valid proposition.

However I would still like to have more control on kernel-specific
wired memory for processes. I'm for example thinking to ARC vs. buffer
cache, where I expect the wired memory consumption to be much bigger
for the former case.

My humble opinion is that userland page wiring should be tuned via
resource limits and that vm.max_wired could be retired altogether.
Kernel wiring ignores the knob anyway.

I think the goal of the limit as it stands would not to let the total 
amount of wired pages reach a bad point due to a userland program 
pushing it over the limit.


Basically userland wants to know how many pages the kernel has wired in 
order to avoid asking for too many pages and making the system implode.

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


svn commit: r267870 - head/tools/ifnet

2014-06-25 Thread Marcel Moolenaar
Author: marcel
Date: Wed Jun 25 15:22:14 2014
New Revision: 267870
URL: http://svnweb.freebsd.org/changeset/base/267870

Log:
  * Handle ++x as well as x++ while converting.
  * Add special case handling where normal conversion would not work
(some APIs have special names)
  * Fix conversion for function calls involving ifnet
  
  Submitted by: Sreekanth Rupavatharam 
  Obtained from:Juniper Networks, Inc.

Modified:
  head/tools/ifnet/convert_drvapi.sh

Modified: head/tools/ifnet/convert_drvapi.sh
==
--- head/tools/ifnet/convert_drvapi.sh  Wed Jun 25 14:23:30 2014
(r267869)
+++ head/tools/ifnet/convert_drvapi.sh  Wed Jun 25 15:22:14 2014
(r267870)
@@ -94,7 +94,7 @@ handle_set() {
 
 handle_inc() {
line=$1 
-   inc=`echo $line | grep "$__ifp__->.*++"`
+   inc=`echo $line | grep "$__ifp__->.*++\|++$__ifp__->.*"`
if [ ! -z "$inc" ]
then
word=`echo $line | awk -F"if_" '{ print $2 }'|awk -F"\+" '{ 
print $1}'`
@@ -161,6 +161,17 @@ handle_and() {
 
 }
 
+handle_toggle() {
+   line=$1
+   if [ ! -z `echo $line | grep "\^="` ]
+   then
+   line=`echo $line | sed -e 's/'"$__ifp__"'->if_\(.*\) 
^=\(.*\);/if_toggle\1('"$__ifp__"',\2);/g'`
+   return 0;
+   fi
+   return 1
+
+}
+
 # XXX - this needs updating
 handle_misc() {
line=$1
@@ -179,6 +190,35 @@ handle_misc() {
 
 }
 
+replace_str ()
+{
+   line=$1
+   orig=$2
+   new=$3
+   line=`echo $line | sed -e 's/'"$orig"'\(.*\)/'"$new"'\1/g'`
+   return 0;
+}
+
+# Handle special cases which do not fall under regular patterns
+handle_special ()
+{
+   line=$1
+   replace_str $line "(\*$__ifp__->if_input)" "if_input"
+   replace_str $line "if_setinit" "if_setinitfn"
+   replace_str $line "if_setioctl" "if_setioctlfn"
+   replace_str $line "if_getdrv_flags" "if_getdrvflags"
+   replace_str $line "if_setdrv_flagsbit" "if_setdrvflagbits"
+   replace_str $line "if_setstart" "if_setstartfn"
+   replace_str $line "if_sethwassistbit" "if_sethwassistbits"
+   replace_str $line "ifmedia_init" "ifmedia_init_drv"
+   replace_str $line "IFQ_DRV_IS_EMPTY(&$__ifp__->if_snd)" 
"if_sendq_empty($__ifp__)"
+   replace_str $line "IFQ_DRV_PREPEND(&$__ifp__->if_snd" 
"if_sendq_prepend($__ifp__"
+   replace_str $line "IFQ_SET_READY(&ifp->if_snd)" 
"if_setsendqready($__ifp__)"
+   line=`echo $line | sed -e 's/IFQ_SET_MAXLEN(&'$__ifp__'->if_snd, 
\(.*\))/if_setsendqlen('$__ifp__', \1)/g'`
+   line=`echo $line | sed -e 's/IFQ_DRV_DEQUEUE(&'$__ifp__'->if_snd, 
\(.*\))/\1 = if_dequeue('$__ifp__')/g'`
+   return 0
+}
+
 if [ -e $file.tmp ]
 then
rm $file.tmp
@@ -201,9 +241,9 @@ do
fi
 
handle_set $line
-   
+
if [ $? != 0 ]
-   then 
+   then 
handle_inc $line
fi
 
@@ -223,19 +263,26 @@ do
fi
 
if [ $? != 0 ]
+   then
+   handle_toggle $line
+   fi
 
+   if [ $? != 0 ]
then
handle_misc $line
fi

if [ $? != 0 ]
then
-   if [ ! -z `echo $line | grep "$__ifp__->"` ]
-   then
-   line=`echo $line | sed -e 's:$: \/* '${FAIL_PAT}' 
*\/:g'`
-   fi
+   handle_special $line
+   fi  
+
+   if [ ! -z `echo $line | grep "$__ifp__->"` ]
+   then
+   line=`echo $line | sed -e 's:$: \/* '${FAIL_PAT}' *\/:g'`
fi
 done
+   line=`echo "$line" | sed -e 
's:VLAN_CAPABILITIES('$__ifp__'):if_vlancap('$__ifp__'):g'`
# Replace the ifnet * with if_t
if [ ! -z `echo $line | grep "struct ifnet"` ]
then
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon

2014-06-25 Thread Attilio Rao
On Wed, Jun 25, 2014 at 5:16 PM, Alfred Perlstein  wrote:
> On 6/25/14 5:41 AM, Attilio Rao wrote:
>>
>> On Wed, Jun 25, 2014 at 2:09 PM, Gleb Smirnoff 
>> wrote:
>>>
>>> On Wed, Jun 25, 2014 at 01:58:29PM +0200, Attilio Rao wrote:
>>> A> > Log:
>>> A> >   xen/virtio: fix balloon drivers to not mark pages as WIRED
>>> A> >
>>> A> >   Prevent the Xen and VirtIO balloon drivers from marking pages as
>>> A> >   wired. This prevents them from increasing the system wired page
>>> count,
>>> A> >   which can lead to mlock failing because of hitting the limit in
>>> A> >   vm.max_wired.
>>> A>
>>> A> This change is conceptually wrong.
>>> A> The pages balloon is allocating are unmanaged and they should be wired
>>> A> by definition. Alan and I are considering enforcing this (mandatory
>>> A> wired pages for unmanaged pages allocation) directly in the KPI.
>>> A> This in practice just seem an artifact to deal with scarce  wired
>>> A> memory limit. I suggest that for the XEN case this limit gets bumped
>>> A> rather relying on similar type of hacks.
>>>
>>> Proper limit would be to count pages wired by userland via mlock(2)
>>> and enforce limit only on those pages. Pages wired by kernel should
>>> be either unlimited or controled by a separate limit.
>>
>> FWIW, I mostly agree with this. I think that the kernel and userland
>> limits should be split apart. But for the time being, rising the limit
>> is better.
>>
>> Attilio
>>
>>
> Can you explain?  I would think that if you were designing some kind of
> embedded device you would want to know exactly how much locked pages there
> are overall, not just in userland.
>
> Meaning you would not want to overcommit and have too many locked pages due
> to kernel+user.

Well, assuming you trace them indipendently I don't think this is
going to be problematic to aggregate them, is it?

As far as I understand it, right now we have RMEM_LIMIT to someway
limit per-process amount of wired memory and finally max_wired as a
global accounted wired memory limit.

I think that the idea now is that RMEM_LIMIT is enough to correctly
control all the front-end check, coming from untrusted sources
(userland, non-privileged syscalls like mlock(), mmap(), etc.).
Possibly that's not always the case and I think that the hypervisor
can be a fair example of this.

Having "more granular" accountability, means that rather than having a
global limit (or, rather, along with it) we can grow a per-process
limit to control kernel-allocated wired memory.

> Perhaps that needs an API as well?

I don't have anything in my mind yet. My initial point was more trying
to get a better semantic on a paradigm that is at least dangerous.

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r267871 - head/usr.bin/whois

2014-06-25 Thread Hajimu UMEMOTO
Author: ume
Date: Wed Jun 25 15:39:08 2014
New Revision: 267871
URL: http://svnweb.freebsd.org/changeset/base/267871

Log:
  Introduce $RA_SERVER to set default whois server.
  
  Requested by: nork
  Reviewed by:  nork
  MFC after:1 week

Modified:
  head/usr.bin/whois/whois.c

Modified: head/usr.bin/whois/whois.c
==
--- head/usr.bin/whois/whois.c  Wed Jun 25 15:22:14 2014(r267870)
+++ head/usr.bin/whois/whois.c  Wed Jun 25 15:39:08 2014(r267871)
@@ -179,10 +179,12 @@ main(int argc, char *argv[])
 * back to NICHOST.
 */
if (host == NULL && country == NULL) {
-   use_qnichost = 1;
-   host = NICHOST;
-   if (!(flags & WHOIS_QUICK))
-   flags |= WHOIS_RECURSE;
+   if ((host = getenv("RA_SERVER")) == NULL) {
+   use_qnichost = 1;
+   host = NICHOST;
+   if (!(flags & WHOIS_QUICK))
+   flags |= WHOIS_RECURSE;
+   }
}
while (argc-- > 0) {
if (country != NULL) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r267872 - head/sys/cam/ctl

2014-06-25 Thread Alexander Motin
Author: mav
Date: Wed Jun 25 16:12:14 2014
New Revision: 267872
URL: http://svnweb.freebsd.org/changeset/base/267872

Log:
  Allow to use iSCSI immediate data by several ctl_datamove() calls.
  
  While for FreeBSD client that is only a minor optimization, VMWare client
  doesn't support additional data requests after all data being sent once as
  immediate.
  
  MFC after:1 week
  Sponsored by: iXsystems, Inc.

Modified:
  head/sys/cam/ctl/ctl_frontend_iscsi.c

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==
--- head/sys/cam/ctl/ctl_frontend_iscsi.c   Wed Jun 25 15:39:08 2014
(r267871)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c   Wed Jun 25 16:12:14 2014
(r267872)
@@ -737,12 +737,15 @@ cfiscsi_handle_data_segment(struct icl_p
buffer_offset = ntohl(bhsdo->bhsdo_buffer_offset);
else
buffer_offset = 0;
+   len = icl_pdu_data_segment_length(request);
 
/*
 * Make sure the offset, as sent by the initiator, matches the offset
 * we're supposed to be at in the scatter-gather list.
 */
-   if (buffer_offset !=
+   if (buffer_offset >
+   io->scsiio.kern_rel_offset + io->scsiio.ext_data_filled ||
+   buffer_offset + len <=
io->scsiio.kern_rel_offset + io->scsiio.ext_data_filled) {
CFISCSI_SESSION_WARN(cs, "received bad buffer offset %zd, "
"expected %zd; dropping connection", buffer_offset,
@@ -758,8 +761,8 @@ cfiscsi_handle_data_segment(struct icl_p
 * to buffer_offset, which is the offset within the task (SCSI
 * command).
 */
-   off = 0;
-   len = icl_pdu_data_segment_length(request);
+   off = io->scsiio.kern_rel_offset + io->scsiio.ext_data_filled -
+   buffer_offset;
 
/*
 * Iterate over the scatter/gather segments, filling them with data
@@ -816,12 +819,8 @@ cfiscsi_handle_data_segment(struct icl_p
 * This obviously can only happen with SCSI Command PDU. 
 */
if ((request->ip_bhs->bhs_opcode & ~ISCSI_BHS_OPCODE_IMMEDIATE) 
==
-   ISCSI_BHS_OPCODE_SCSI_COMMAND) {
-   CFISCSI_SESSION_DEBUG(cs, "received too much immediate "
-   "data: got %zd bytes, expected %zd",
-   icl_pdu_data_segment_length(request), off);
+   ISCSI_BHS_OPCODE_SCSI_COMMAND)
return (true);
-   }
 
CFISCSI_SESSION_WARN(cs, "received too much data: got %zd 
bytes, "
"expected %zd; dropping connection",
@@ -2708,8 +2707,8 @@ cfiscsi_datamove_out(union ctl_io *io)
cdw->cdw_target_transfer_tag = target_transfer_tag;
cdw->cdw_initiator_task_tag = bhssc->bhssc_initiator_task_tag;
 
-   if (cs->cs_immediate_data && io->scsiio.kern_rel_offset == 0 &&
-   icl_pdu_data_segment_length(request) > 0) {
+   if (cs->cs_immediate_data && io->scsiio.kern_rel_offset <
+   icl_pdu_data_segment_length(request)) {
done = cfiscsi_handle_data_segment(request, cdw);
if (done) {
uma_zfree(cfiscsi_data_wait_zone, cdw);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon

2014-06-25 Thread Alan Cox
On 06/25/2014 08:29, Roger Pau Monné wrote:
> On 25/06/14 13:58, Attilio Rao wrote:
>> On Wed, Jun 25, 2014 at 11:51 AM, Roger Pau Monné  wrote:
>>> Author: royger
>>> Date: Wed Jun 25 09:51:08 2014
>>> New Revision: 267858
>>> URL: http://svnweb.freebsd.org/changeset/base/267858
>>>
>>> Log:
>>>   xen/virtio: fix balloon drivers to not mark pages as WIRED
>>>
>>>   Prevent the Xen and VirtIO balloon drivers from marking pages as
>>>   wired. This prevents them from increasing the system wired page count,
>>>   which can lead to mlock failing because of hitting the limit in
>>>   vm.max_wired.
>> This change is conceptually wrong.
>> The pages balloon is allocating are unmanaged and they should be wired
>> by definition. Alan and I are considering enforcing this (mandatory
>> wired pages for unmanaged pages allocation) directly in the KPI.
>> This in practice just seem an artifact to deal with scarce  wired
>> memory limit. I suggest that for the XEN case this limit gets bumped
>> rather relying on similar type of hacks.
> IMHO, marking them as wired seems wrong too, those pages are not wired,
> they are simply not there any more. This was discussed in:
>
> http://lists.freebsd.org/pipermail/freebsd-virtualization/2014-June/002643.html
>
> If there's consensus I will revert the change, but I would say that
> increasing vm.max_wired for VMs is also a gross hack.

We wouldn't be changing it just for VMs.  Our current definition of
vm_max_wired dates back to r5455, or in human years 1995.  If the ZFS
ARC has taught us anything, we, or really the page daemon, can cope with
having more than 1/3 of a machine's pages wired.  :-)

I have a couple questions for you.  Exactly how much memory will Xen try
to steal from a domain via ballooning?  Clearly the domain can fail to
respond to the balloon request and Xen has to cope with that.  Can the
domain also explicitly say, "No, I'm not giving you any pages."

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

svn commit: r267873 - head/sys/cam/ctl

2014-06-25 Thread Alexander Motin
Author: mav
Date: Wed Jun 25 17:02:01 2014
New Revision: 267873
URL: http://svnweb.freebsd.org/changeset/base/267873

Log:
  Introduce fine-grained CTL locking to improve SMP scalability.
  
  Split global ctl_lock, historically protecting most of CTL context:
   - remaining ctl_lock now protects lists of fronends and backends;
   - per-LUN lun_lock(s) protect LUN-specific information;
   - per-thread queue_lock(s) protect request queues.
  This allows to radically reduce congestion on ctl_lock.
  
  Create multiple worker threads, depending on number of CPUs, and assign
  each LUN to one of them.  This allows to spread load between multiple CPUs,
  still avoiging congestion on queues and LUNs locks.
  
  On 40-core server, exporting 5 LUNs, each backed by gstripe of SATA SSDs,
  accessed via 6 iSCSI connections, this change improves peak request rate
  from 250K to 680K IOPS.
  
  MFC after:2 weeks
  Sponsored by: iXsystems, Inc.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl.h
  head/sys/cam/ctl/ctl_io.h
  head/sys/cam/ctl/ctl_private.h

Modified: head/sys/cam/ctl/ctl.c
==
--- head/sys/cam/ctl/ctl.c  Wed Jun 25 16:12:14 2014(r267872)
+++ head/sys/cam/ctl/ctl.c  Wed Jun 25 17:02:01 2014(r267873)
@@ -83,14 +83,6 @@ __FBSDID("$FreeBSD$");
 struct ctl_softc *control_softc = NULL;
 
 /*
- * The default is to run with CTL_DONE_THREAD turned on.  Completed
- * transactions are queued for processing by the CTL work thread.  When
- * CTL_DONE_THREAD is not defined, completed transactions are processed in
- * the caller's context.
- */
-#define CTL_DONE_THREAD
-
-/*
  * Size and alignment macros needed for Copan-specific HA hardware.  These
  * can go away when the HA code is re-written, and uses busdma for any
  * hardware.
@@ -315,7 +307,7 @@ static int ctl_is_single = 1;
 static int index_to_aps_page;
 
 SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD, 0, "CAM Target Layer");
-static int worker_threads = 1;
+static int worker_threads = -1;
 TUNABLE_INT("kern.cam.ctl.worker_threads", &worker_threads);
 SYSCTL_INT(_kern_cam_ctl, OID_AUTO, worker_threads, CTLFLAG_RDTUN,
 &worker_threads, 1, "Number of worker threads");
@@ -344,7 +336,7 @@ static int ctl_ioctl_targ_disable(void *
 static int ctl_ioctl_lun_enable(void *arg, struct ctl_id targ_id, int lun_id);
 static int ctl_ioctl_lun_disable(void *arg, struct ctl_id targ_id, int lun_id);
 static int ctl_ioctl_do_datamove(struct ctl_scsiio *ctsio);
-static int ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio, int have_lock);
+static int ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio);
 static int ctl_ioctl_submit_wait(union ctl_io *io);
 static void ctl_ioctl_datamove(union ctl_io *io);
 static void ctl_ioctl_done(union ctl_io *io);
@@ -431,8 +423,13 @@ static int ctl_datamove_remote_xfer(unio
ctl_ha_dt_cb callback);
 static void ctl_datamove_remote_read(union ctl_io *io);
 static void ctl_datamove_remote(union ctl_io *io);
-static int ctl_process_done(union ctl_io *io, int have_lock);
+static int ctl_process_done(union ctl_io *io);
+static void ctl_lun_thread(void *arg);
 static void ctl_work_thread(void *arg);
+static void ctl_enqueue_incoming(union ctl_io *io);
+static void ctl_enqueue_rtr(union ctl_io *io);
+static void ctl_enqueue_done(union ctl_io *io);
+static void ctl_enqueue_isc(union ctl_io *io);
 
 /*
  * Load the serialization table.  This isn't very pretty, but is probably
@@ -490,8 +487,7 @@ ctl_isc_handler_finish_xfer(struct ctl_s
   sizeof(ctsio->sense_data));
memcpy(&ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes,
   &msg_info->scsi.lbalen, sizeof(msg_info->scsi.lbalen));
-   STAILQ_INSERT_TAIL(&ctl_softc->isc_queue, &ctsio->io_hdr, links);
-   ctl_wakeup_thread();
+   ctl_enqueue_isc((union ctl_io *)ctsio);
 }
 
 static void
@@ -537,8 +533,7 @@ ctl_isc_handler_finish_ser_only(struct c
}
 #endif
ctsio->io_hdr.msg_type = CTL_MSG_FINISH_IO;
-   STAILQ_INSERT_TAIL(&ctl_softc->isc_queue, &ctsio->io_hdr, links);
-   ctl_wakeup_thread();
+   ctl_enqueue_isc((union ctl_io *)ctsio);
 }
 
 /*
@@ -573,7 +568,6 @@ ctl_isc_event_handler(ctl_ha_channel cha
   isc_status);
return;
}
-   mtx_lock(&ctl_softc->ctl_lock);
 
switch (msg_info.hdr.msg_type) {
case CTL_MSG_SERIALIZE:
@@ -586,7 +580,6 @@ ctl_isc_event_handler(ctl_ha_channel cha
   "ctl_io!\n");
/* Bad Juju */
/* Need to set busy and send msg back */
-   mtx_unlock(&ctl_softc->ctl_lock);
msg_info.hdr.msg_type = CTL_MSG_BAD_JUJU;
msg_info.hdr.status = CTL_SCSI_ERROR

Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon

2014-06-25 Thread Julian Elischer

On 6/25/14, 11:16 PM, Alfred Perlstein wrote:

On 6/25/14 5:41 AM, Attilio Rao wrote:
On Wed, Jun 25, 2014 at 2:09 PM, Gleb Smirnoff 
 wrote:

On Wed, Jun 25, 2014 at 01:58:29PM +0200, Attilio Rao wrote:
A> > Log:
A> >   xen/virtio: fix balloon drivers to not mark pages as WIRED
A> >
A> >   Prevent the Xen and VirtIO balloon drivers from marking 
pages as
A> >   wired. This prevents them from increasing the system wired 
page count,
A> >   which can lead to mlock failing because of hitting the 
limit in

A> >   vm.max_wired.
A>
A> This change is conceptually wrong.
A> The pages balloon is allocating are unmanaged and they should 
be wired
A> by definition. Alan and I are considering enforcing this 
(mandatory

A> wired pages for unmanaged pages allocation) directly in the KPI.
A> This in practice just seem an artifact to deal with scarce  wired
A> memory limit. I suggest that for the XEN case this limit gets 
bumped

A> rather relying on similar type of hacks.

Proper limit would be to count pages wired by userland via mlock(2)
and enforce limit only on those pages. Pages wired by kernel should
be either unlimited or controled by a separate limit.

FWIW, I mostly agree with this. I think that the kernel and userland
limits should be split apart. But for the time being, rising the limit
is better.

Attilio


Can you explain?  I would think that if you were designing some kind 
of embedded device you would want to know exactly how much locked 
pages there are overall, not just in userland.


Meaning you would not want to overcommit and have too many locked 
pages due to kernel+user.


Perhaps that needs an API as well?


these pages are the VM equivalent of memory pages that were 'found to 
be flaky and taken out of service"

I think "wired" is a bad description for those.


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


Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon

2014-06-25 Thread Alan Cox
On 06/25/2014 12:12, Julian Elischer wrote:
> On 6/25/14, 11:16 PM, Alfred Perlstein wrote:
>> On 6/25/14 5:41 AM, Attilio Rao wrote:
>>> On Wed, Jun 25, 2014 at 2:09 PM, Gleb Smirnoff 
>>> wrote:
 On Wed, Jun 25, 2014 at 01:58:29PM +0200, Attilio Rao wrote:
 A> > Log:
 A> >   xen/virtio: fix balloon drivers to not mark pages as WIRED
 A> >
 A> >   Prevent the Xen and VirtIO balloon drivers from marking
 pages as
 A> >   wired. This prevents them from increasing the system wired
 page count,
 A> >   which can lead to mlock failing because of hitting the limit in
 A> >   vm.max_wired.
 A>
 A> This change is conceptually wrong.
 A> The pages balloon is allocating are unmanaged and they should be
 wired
 A> by definition. Alan and I are considering enforcing this (mandatory
 A> wired pages for unmanaged pages allocation) directly in the KPI.
 A> This in practice just seem an artifact to deal with scarce  wired
 A> memory limit. I suggest that for the XEN case this limit gets
 bumped
 A> rather relying on similar type of hacks.

 Proper limit would be to count pages wired by userland via mlock(2)
 and enforce limit only on those pages. Pages wired by kernel should
 be either unlimited or controled by a separate limit.
>>> FWIW, I mostly agree with this. I think that the kernel and userland
>>> limits should be split apart. But for the time being, rising the limit
>>> is better.
>>>
>>> Attilio
>>>
>>>
>> Can you explain?  I would think that if you were designing some kind
>> of embedded device you would want to know exactly how much locked
>> pages there are overall, not just in userland.
>>
>> Meaning you would not want to overcommit and have too many locked
>> pages due to kernel+user.
>>
>> Perhaps that needs an API as well?
>
> these pages are the VM equivalent of memory pages that were 'found to
> be flaky and taken out of service"
> I think "wired" is a bad description for those.
>
>
>

That doesn't matter.  To the rest of the VM system, and, in particular,
the page daemon, one category is indistinguishable from the other.

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


svn commit: r267875 - head/cddl/contrib/opensolaris/lib/libdtrace/common

2014-06-25 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Jun 25 17:27:15 2014
New Revision: 267875
URL: http://svnweb.freebsd.org/changeset/base/267875

Log:
  MFV   r258381:
  
  4251 libdtrace leaks open file handles
  
  Illumos commit:   93ed8d0d4b068b95d0bb50d57bb854df462a8485
(partial)
  Reference:
  https://www.illumos.org/issues/4251
  
  Discussed with:   Robert Mustacchi
  Obtained from:Illumos
  MFC after:1 week

Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c
==
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c  Wed Jun 25 
17:10:26 2014(r267874)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c  Wed Jun 25 
17:27:15 2014(r267875)
@@ -2268,12 +2268,15 @@ dt_load_libs_dir(dtrace_hdl_t *dtp, cons
dt_dprintf("skipping library %s, already processed "
"library with the same name: %s", dp->d_name,
dld->dtld_library);
+   (void) fclose(fp);
continue;
}
 
dtp->dt_filetag = fname;
-   if (dt_lib_depend_add(dtp, &dtp->dt_lib_dep, fname) != 0)
+   if (dt_lib_depend_add(dtp, &dtp->dt_lib_dep, fname) != 0) {
+   (void) fclose(fp);
return (-1); /* preserve dt_errno */
+   }
 
rv = dt_compile(dtp, DT_CTX_DPROG,
DTRACE_PROBESPEC_NAME, NULL,
@@ -2281,8 +2284,10 @@ dt_load_libs_dir(dtrace_hdl_t *dtp, cons
 
if (rv != NULL && dtp->dt_errno &&
(dtp->dt_errno != EDT_COMPILER ||
-   dtp->dt_errtag != dt_errtag(D_PRAGMA_DEPEND)))
+   dtp->dt_errtag != dt_errtag(D_PRAGMA_DEPEND))) {
+   (void) fclose(fp);
return (-1); /* preserve dt_errno */
+   }
 
if (dtp->dt_errno)
dt_dprintf("error parsing library %s: %s\n",
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon

2014-06-25 Thread Roger Pau Monné
On 25/06/14 18:47, Alan Cox wrote:
> On 06/25/2014 08:29, Roger Pau Monné wrote:
>> On 25/06/14 13:58, Attilio Rao wrote:
>>> On Wed, Jun 25, 2014 at 11:51 AM, Roger Pau Monné  
>>> wrote:
 Author: royger
 Date: Wed Jun 25 09:51:08 2014
 New Revision: 267858
 URL: http://svnweb.freebsd.org/changeset/base/267858

 Log:
   xen/virtio: fix balloon drivers to not mark pages as WIRED

   Prevent the Xen and VirtIO balloon drivers from marking pages as
   wired. This prevents them from increasing the system wired page count,
   which can lead to mlock failing because of hitting the limit in
   vm.max_wired.
>>> This change is conceptually wrong.
>>> The pages balloon is allocating are unmanaged and they should be wired
>>> by definition. Alan and I are considering enforcing this (mandatory
>>> wired pages for unmanaged pages allocation) directly in the KPI.
>>> This in practice just seem an artifact to deal with scarce  wired
>>> memory limit. I suggest that for the XEN case this limit gets bumped
>>> rather relying on similar type of hacks.
>> IMHO, marking them as wired seems wrong too, those pages are not wired,
>> they are simply not there any more. This was discussed in:
>>
>> http://lists.freebsd.org/pipermail/freebsd-virtualization/2014-June/002643.html
>>
>> If there's consensus I will revert the change, but I would say that
>> increasing vm.max_wired for VMs is also a gross hack.
> 
> We wouldn't be changing it just for VMs.  Our current definition of
> vm_max_wired dates back to r5455, or in human years 1995.  If the ZFS
> ARC has taught us anything, we, or really the page daemon, can cope with
> having more than 1/3 of a machine's pages wired.  :-)
> 
> I have a couple questions for you.  Exactly how much memory will Xen try
> to steal from a domain via ballooning?  Clearly the domain can fail to
> respond to the balloon request and Xen has to cope with that.  Can the
> domain also explicitly say, "No, I'm not giving you any pages."

Xen itself won't try to steal any memory from a VM, this is AFAIK
initiated by the host admin (or maybe some high-level orchestration
toolstack), which requests the domain to balloon down. The domain is
never forced to balloon down, is just a petition that the VM usually
tries to satisfy as much as it can (or completely ignore it).

As said before, I'm not sure what high-level toolstacks will do, maybe
some of them will just kill the domain if it doesn't balloon down as
expected, but I would be quite surprised if that's the case.

For example I've tried ballooning down a FreeBSD VM from 2GB to 256MB,
and only got it to ~300MB, but that's perfectly fine IMHO.

Roger.

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

svn commit: r267877 - head/sys/cam/ctl

2014-06-25 Thread Alexander Motin
Author: mav
Date: Wed Jun 25 17:54:36 2014
New Revision: 267877
URL: http://svnweb.freebsd.org/changeset/base/267877

Log:
  Lock devstat updates in block backend to make it usable.  Polish lock names.
  
  MFC after:2 weeks
  Sponsored by: iXsystems, Inc.

Modified:
  head/sys/cam/ctl/ctl_backend_block.c
  head/sys/cam/ctl/ctl_backend_ramdisk.c

Modified: head/sys/cam/ctl/ctl_backend_block.c
==
--- head/sys/cam/ctl/ctl_backend_block.cWed Jun 25 17:34:04 2014
(r267876)
+++ head/sys/cam/ctl/ctl_backend_block.cWed Jun 25 17:54:36 2014
(r267877)
@@ -160,7 +160,6 @@ struct ctl_be_block_lun {
cbb_dispatch_t dispatch;
cbb_dispatch_t lun_flush;
cbb_dispatch_t unmap;
-   struct mtx lock;
uma_zone_t lun_zone;
uint64_t size_blocks;
uint64_t size_bytes;
@@ -179,6 +178,8 @@ struct ctl_be_block_lun {
STAILQ_HEAD(, ctl_io_hdr) input_queue;
STAILQ_HEAD(, ctl_io_hdr) config_write_queue;
STAILQ_HEAD(, ctl_io_hdr) datamove_queue;
+   struct mtx_padalign io_lock;
+   struct mtx_padalign queue_lock;
 };
 
 /*
@@ -336,22 +337,7 @@ ctl_free_beio(struct ctl_be_block_io *be
 static void
 ctl_complete_beio(struct ctl_be_block_io *beio)
 {
-   union ctl_io *io;
-   int io_len;
-
-   io = beio->io;
-
-   if ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)
-   io_len = beio->io_len;
-   else
-   io_len = 0;
-
-   devstat_end_transaction(beio->lun->disk_stats,
-   /*bytes*/ io_len,
-   beio->ds_tag_type,
-   beio->ds_trans_type,
-   /*now*/ NULL,
-   /*then*/&beio->ds_t0);
+   union ctl_io *io = beio->io;
 
if (beio->beio_cont != NULL) {
beio->beio_cont(beio);
@@ -449,14 +435,14 @@ ctl_be_block_move_done(union ctl_io *io)
 * This move done routine is generally called in the SIM's
 * interrupt context, and therefore we cannot block.
 */
-   mtx_lock(&be_lun->lock);
+   mtx_lock(&be_lun->queue_lock);
/*
 * XXX KDM make sure that links is okay to use at this point.
 * Otherwise, we either need to add another field to ctl_io_hdr,
 * or deal with resource allocation here.
 */
STAILQ_INSERT_TAIL(&be_lun->datamove_queue, &io->io_hdr, links);
-   mtx_unlock(&be_lun->lock);
+   mtx_unlock(&be_lun->queue_lock);
 
taskqueue_enqueue(be_lun->io_taskqueue, &be_lun->io_task);
 
@@ -478,7 +464,7 @@ ctl_be_block_biodone(struct bio *bio)
DPRINTF("entered\n");
 
error = bio->bio_error;
-   mtx_lock(&be_lun->lock);
+   mtx_lock(&be_lun->io_lock);
if (error != 0)
beio->num_errors++;
 
@@ -496,7 +482,7 @@ ctl_be_block_biodone(struct bio *bio)
 */
if ((beio->send_complete == 0)
 || (beio->num_bios_done < beio->num_bios_sent)) {
-   mtx_unlock(&be_lun->lock);
+   mtx_unlock(&be_lun->io_lock);
return;
}
 
@@ -504,7 +490,10 @@ ctl_be_block_biodone(struct bio *bio)
 * At this point, we've verified that we are the last I/O to
 * complete, so it's safe to drop the lock.
 */
-   mtx_unlock(&be_lun->lock);
+   devstat_end_transaction(beio->lun->disk_stats, beio->io_len,
+   beio->ds_tag_type, beio->ds_trans_type,
+   /*now*/ NULL, /*then*/&beio->ds_t0);
+   mtx_unlock(&be_lun->io_lock);
 
/*
 * If there are any errors from the backing device, we fail the
@@ -546,15 +535,18 @@ static void
 ctl_be_block_flush_file(struct ctl_be_block_lun *be_lun,
struct ctl_be_block_io *beio)
 {
-   union ctl_io *io;
+   union ctl_io *io = beio->io;
struct mount *mountpoint;
int error, lock_flags;
 
DPRINTF("entered\n");
 
-   io = beio->io;
+   binuptime(&beio->ds_t0);
+   mtx_lock(&be_lun->io_lock);
+   devstat_start_transaction(beio->lun->disk_stats, &beio->ds_t0);
+   mtx_unlock(&be_lun->io_lock);
 
-   (void) vn_start_write(be_lun->vn, &mountpoint, V_WAIT);
+   (void) vn_start_write(be_lun->vn, &mountpoint, V_WAIT);
 
if (MNT_SHARED_WRITES(mountpoint)
 || ((mountpoint == NULL)
@@ -565,14 +557,17 @@ ctl_be_block_flush_file(struct ctl_be_bl
 
vn_lock(be_lun->vn, lock_flags | LK_RETRY);
 
-   binuptime(&beio->ds_t0);
-   devstat_start_transaction(beio->lun->disk_stats, &beio->ds_t0);
-
error = VOP_FSYNC(be_lun->vn, MNT_WAIT, curthread);
VOP_UNLOCK(be_lun->vn, 0);
 
vn_finished_write(mountpoint);
 
+   mtx_lock(&be_lun->io_lock);
+   devstat_end_transaction(beio->lun->disk_stats, beio->io_len,
+   beio->ds_tag_type, beio->ds_trans_ty

svn commit: r267883 - head/sys/dev/acpica

2014-06-25 Thread John Baldwin
Author: jhb
Date: Wed Jun 25 20:30:47 2014
New Revision: 267883
URL: http://svnweb.freebsd.org/changeset/base/267883

Log:
  Expand r261243 even further and ignore any I/O port resources assigned to
  PCI root bridges except for the one known-valid case on x86 where bridges
  claim the I/O port registers used for PCI config space access.
  
  Tested by:Hilko Meyer 
  MFC after:1 week

Modified:
  head/sys/dev/acpica/acpi.c

Modified: head/sys/dev/acpica/acpi.c
==
--- head/sys/dev/acpica/acpi.c  Wed Jun 25 19:41:39 2014(r267882)
+++ head/sys/dev/acpica/acpi.c  Wed Jun 25 20:30:47 2014(r267883)
@@ -1196,15 +1196,24 @@ acpi_set_resource(device_t dev, device_t
return (0);
 
 /*
- * Ignore memory resources for PCI root bridges.  Some BIOSes
+ * Ignore most resources for PCI root bridges.  Some BIOSes
  * incorrectly enumerate the memory ranges they decode as plain
- * memory resources instead of as a ResourceProducer range.
+ * memory resources instead of as ResourceProducer ranges.  Other
+ * BIOSes incorrectly list system resource entries for I/O ranges
+ * under the PCI bridge.  Do allow the one known-correct case on
+ * x86 of a PCI bridge claiming the I/O ports used for PCI config
+ * access.
  */
-if (type == SYS_RES_MEMORY) {
+if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) {
if (ACPI_SUCCESS(AcpiGetObjectInfo(ad->ad_handle, &devinfo))) {
if ((devinfo->Flags & ACPI_PCI_ROOT_BRIDGE) != 0) {
-   AcpiOsFree(devinfo);
-   return (0);
+#if defined(__i386__) || defined(__amd64__)
+   if (!(type == SYS_RES_IOPORT && start == CONF1_ADDR_PORT))
+#endif
+   {
+   AcpiOsFree(devinfo);
+   return (0);
+   }
}
AcpiOsFree(devinfo);
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r267884 - head/sys/amd64/vmm

2014-06-25 Thread Peter Grehan
Author: grehan
Date: Wed Jun 25 22:13:35 2014
New Revision: 267884
URL: http://svnweb.freebsd.org/changeset/base/267884

Log:
  Expose the amount of resident and wired memory from the guest's vmspace.
  
  This is different than the amount shown for the process e.g. by
  /usr/bin/top - that is the mappings faulted in by the mmap'd region
  of guest memory.
  
  The values can be fetched with bhyvectl
  
   # bhyvectl --get-stats --vm=myvm
   ...
   Resident memory  413749248
   Wired memory 0
   ...
  
  vmm_stat.[ch] -
   Modify the counter code in bhyve to allow direct setting of a counter
  as opposed to incrementing, and providing a callback to fetch a
  counter's value.
  
  Reviewed by:  neel

Modified:
  head/sys/amd64/vmm/vmm.c
  head/sys/amd64/vmm/vmm_stat.c
  head/sys/amd64/vmm/vmm_stat.h

Modified: head/sys/amd64/vmm/vmm.c
==
--- head/sys/amd64/vmm/vmm.cWed Jun 25 20:30:47 2014(r267883)
+++ head/sys/amd64/vmm/vmm.cWed Jun 25 22:13:35 2014(r267884)
@@ -1992,3 +1992,34 @@ vm_segment_name(int seg)
("%s: invalid segment encoding %d", __func__, seg));
return (seg_names[seg]);
 }
+
+
+/*
+ * Return the amount of in-use and wired memory for the VM. Since
+ * these are global stats, only return the values with for vCPU 0
+ */
+VMM_STAT_DECLARE(VMM_MEM_RESIDENT);
+VMM_STAT_DECLARE(VMM_MEM_WIRED);
+
+static void
+vm_get_rescnt(struct vm *vm, int vcpu, struct vmm_stat_type *stat)
+{
+
+   if (vcpu == 0) {
+   vmm_stat_set(vm, vcpu, VMM_MEM_RESIDENT,
+   PAGE_SIZE * vmspace_resident_count(vm->vmspace));
+   }   
+}
+
+static void
+vm_get_wiredcnt(struct vm *vm, int vcpu, struct vmm_stat_type *stat)
+{
+
+   if (vcpu == 0) {
+   vmm_stat_set(vm, vcpu, VMM_MEM_WIRED,
+   PAGE_SIZE * pmap_wired_count(vmspace_pmap(vm->vmspace)));
+   }   
+}
+
+VMM_STAT_FUNC(VMM_MEM_RESIDENT, "Resident memory", vm_get_rescnt);
+VMM_STAT_FUNC(VMM_MEM_WIRED, "Wired memory", vm_get_wiredcnt);

Modified: head/sys/amd64/vmm/vmm_stat.c
==
--- head/sys/amd64/vmm/vmm_stat.c   Wed Jun 25 20:30:47 2014
(r267883)
+++ head/sys/amd64/vmm/vmm_stat.c   Wed Jun 25 22:13:35 2014
(r267884)
@@ -83,12 +83,21 @@ vmm_stat_register(void *arg)
 int
 vmm_stat_copy(struct vm *vm, int vcpu, int *num_stats, uint64_t *buf)
 {
-   int i;
+   struct vmm_stat_type *vst;
uint64_t *stats;
+   int i;
 
if (vcpu < 0 || vcpu >= VM_MAXCPU)
return (EINVAL);
-   
+
+   /* Let stats functions update their counters */
+   for (i = 0; i < vst_num_types; i++) {
+   vst = vsttab[i];
+   if (vst->func != NULL)
+   (*vst->func)(vm, vcpu, vst);
+   }
+
+   /* Copy over the stats */
stats = vcpu_stats(vm, vcpu);
for (i = 0; i < vst_num_elems; i++)
buf[i] = stats[i];

Modified: head/sys/amd64/vmm/vmm_stat.h
==
--- head/sys/amd64/vmm/vmm_stat.h   Wed Jun 25 20:30:47 2014
(r267883)
+++ head/sys/amd64/vmm/vmm_stat.h   Wed Jun 25 22:13:35 2014
(r267884)
@@ -42,21 +42,29 @@ enum vmm_stat_scope {
VMM_STAT_SCOPE_AMD, /* AMD SVM specific statistic */
 };
 
+struct vmm_stat_type;
+typedef void (*vmm_stat_func_t)(struct vm *vm, int vcpu,
+struct vmm_stat_type *stat);
+
 struct vmm_stat_type {
int index;  /* position in the stats buffer */
int nelems; /* standalone or array */
const char *desc;   /* description of statistic */
+   vmm_stat_func_t func;
enum vmm_stat_scope scope;
 };
 
 void   vmm_stat_register(void *arg);
 
-#defineVMM_STAT_DEFINE(type, nelems, desc, scope)  
\
+#defineVMM_STAT_FDEFINE(type, nelems, desc, func, scope)   
\
struct vmm_stat_type type[1] = {\
-   { -1, nelems, desc, scope } \
+   { -1, nelems, desc, func, scope }   \
};  \
SYSINIT(type##_stat, SI_SUB_KLD, SI_ORDER_ANY, vmm_stat_register, type)
 
+#define VMM_STAT_DEFINE(type, nelems, desc, scope) \
+   VMM_STAT_FDEFINE(type, nelems, desc, NULL, scope)
+
 #defineVMM_STAT_DECLARE(type)  
\
extern struct vmm_stat_type type[1]
 
@@ -67,6 +75,9 @@ void  vmm_stat_register(void *arg);
 #defineVMM_STAT_AMD(type, desc)\
VMM_STAT_DEFINE(type, 1, desc, VMM_STAT_SCOPE_AMD)
 
+#de

svn commit: r267886 - head/usr.bin/procstat

2014-06-25 Thread Xin LI
Author: delphij
Date: Wed Jun 25 23:42:53 2014
New Revision: 267886
URL: http://svnweb.freebsd.org/changeset/base/267886

Log:
  Use correct length for buffer.
  
  Submitted by: Sascha Wildner 
  MFC after:2 weeks

Modified:
  head/usr.bin/procstat/procstat_files.c

Modified: head/usr.bin/procstat/procstat_files.c
==
--- head/usr.bin/procstat/procstat_files.c  Wed Jun 25 22:59:12 2014
(r267885)
+++ head/usr.bin/procstat/procstat_files.c  Wed Jun 25 23:42:53 2014
(r267886)
@@ -114,7 +114,7 @@ addr_to_string(struct sockaddr_storage *
snprintf(buffer, buflen, "%s.%d", buffer2,
ntohs(sin6->sin6_port));
else
-   strlcpy(buffer, "-", sizeof(buffer));
+   strlcpy(buffer, "-", buflen);
break;
 
default:
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r267887 - head/usr.bin/gzip

2014-06-25 Thread Xin LI
Author: delphij
Date: Thu Jun 26 00:31:58 2014
New Revision: 267887
URL: http://svnweb.freebsd.org/changeset/base/267887

Log:
  Correct buffer size.
  
  Submitted by: Sascha Wildner 
  MFC after:2 weeks

Modified:
  head/usr.bin/gzip/zuncompress.c

Modified: head/usr.bin/gzip/zuncompress.c
==
--- head/usr.bin/gzip/zuncompress.c Wed Jun 25 23:42:53 2014
(r267886)
+++ head/usr.bin/gzip/zuncompress.c Thu Jun 26 00:31:58 2014
(r267887)
@@ -145,7 +145,7 @@ zuncompress(FILE *in, FILE *out, char *p
else
compressed_pre = NULL;
 
-   while ((bin = fread(buf, 1, sizeof(buf), in)) != 0) {
+   while ((bin = fread(buf, 1, BUFSIZE, in)) != 0) {
if (tflag == 0 && (off_t)fwrite(buf, 1, bin, out) != bin) {
free(buf);
return -1;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r267891 - head/sys/netinet

2014-06-25 Thread Adrian Chadd
Author: adrian
Date: Thu Jun 26 02:49:51 2014
New Revision: 267891
URL: http://svnweb.freebsd.org/changeset/base/267891

Log:
  Add another RSS method to query the indirection table entries.
  
  There's 128 indirection table entries which correspond to the
  low 7 bits of the 32 bit RSS hash.  Each value will correspond
  to an RSS bucket.  (Then each RSS bucket currently will map
  to a CPU.)
  
  This is a more explicit way of figuring out which RSS bucket
  is in each RSS indirection slot.  It can be inferred by the other
  methods but I'd rather drivers use something more simplified and
  explicit.

Modified:
  head/sys/netinet/in_rss.c
  head/sys/netinet/in_rss.h

Modified: head/sys/netinet/in_rss.c
==
--- head/sys/netinet/in_rss.c   Thu Jun 26 02:39:17 2014(r267890)
+++ head/sys/netinet/in_rss.c   Thu Jun 26 02:49:51 2014(r267891)
@@ -400,6 +400,26 @@ rss_getbucket(u_int hash)
 }
 
 /*
+ * Query the RSS layer bucket associated with the given
+ * entry in the RSS hash space.
+ *
+ * The RSS indirection table is 0 .. rss_buckets-1,
+ * covering the low 'rss_bits' of the total 128 slot
+ * RSS indirection table.  So just mask off rss_bits and
+ * return that.
+ *
+ * NIC drivers can then iterate over the 128 slot RSS
+ * indirection table and fetch which RSS bucket to
+ * map it to.  This will typically be a CPU queue
+ */
+u_int
+rss_get_indirection_to_bucket(u_int index)
+{
+
+   return (index & rss_mask);
+}
+
+/*
  * Query the RSS CPU associated with an RSS bucket.
  */
 u_int

Modified: head/sys/netinet/in_rss.h
==
--- head/sys/netinet/in_rss.h   Thu Jun 26 02:39:17 2014(r267890)
+++ head/sys/netinet/in_rss.h   Thu Jun 26 02:49:51 2014(r267891)
@@ -69,6 +69,7 @@
  */
 u_int  rss_getbits(void);
 u_int  rss_getbucket(u_int hash);
+u_int  rss_get_indirection_to_bucket(u_int index);
 u_int  rss_getcpu(u_int bucket);
 void   rss_getkey(uint8_t *key);
 u_int  rss_gethashalgo(void);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r267895 - head/sys/netinet

2014-06-25 Thread Adrian Chadd
Author: adrian
Date: Thu Jun 26 04:12:41 2014
New Revision: 267895
URL: http://svnweb.freebsd.org/changeset/base/267895

Log:
  Retire IP_RSSCPUID ; the right thing to do is query the RSS bucket;
  map the bucket to an RSS queue, then map the queue to a CPU ID.
  This way the bucket->queue and queue->CPU mapping can change
  over time.
  
  Introduce IP_RSSBUCKETID - which instead looks up the RSS bucket.
  User applications can then map the RSS bucket to a CPU.

Modified:
  head/sys/netinet/in.h
  head/sys/netinet/ip_output.c

Modified: head/sys/netinet/in.h
==
--- head/sys/netinet/in.h   Thu Jun 26 04:04:53 2014(r267894)
+++ head/sys/netinet/in.h   Thu Jun 26 04:12:41 2014(r267895)
@@ -468,9 +468,10 @@ __END_DECLS
 #defineIP_MINTTL   66   /* minimum TTL for packet or drop 
*/
 #defineIP_DONTFRAG 67   /* don't fragment packet */
 #defineIP_RECVTOS  68   /* bool; receive IP TOS w/dgram */
-#defineIP_FLOWID   69   /* flow id for the given 
socket/inp */
-#defineIP_FLOWTYPE 70   /* flow type (M_HASHTYPE) */
-#defineIP_RSSCPUID 71   /* RSS flowid -> CPU id mapping */
+#defineIP_FLOWID   69   /* get flow id for the given 
socket/inp */
+#defineIP_FLOWTYPE 70   /* get flow type (M_HASHTYPE) */
+/* 71 - XXX was IP_RSSCPUID - can recycle whenever */
+#defineIP_RSSBUCKETID  72   /* get RSS flowid -> bucket 
mapping */
 
 /* IPv4 Source Filter Multicast API [RFC3678] */
 #defineIP_ADD_SOURCE_MEMBERSHIP70   /* join a source-specific 
group */

Modified: head/sys/netinet/ip_output.c
==
--- head/sys/netinet/ip_output.cThu Jun 26 04:04:53 2014
(r267894)
+++ head/sys/netinet/ip_output.cThu Jun 26 04:12:41 2014
(r267895)
@@ -1244,9 +1244,14 @@ ip_ctloutput(struct socket *so, struct s
optval = inp->inp_flowtype;
break;
 #ifdef RSS
-   case IP_RSSCPUID:
-   optval = rss_hash2cpuid(inp->inp_flowid,
-   inp->inp_flowtype);
+   case IP_RSSBUCKETID:
+   retval = rss_hash2bucket(inp->inp_flowid,
+   inp->inp_flowtype,
+   &rss_bucket);
+   if (retval == 0)
+   optval = rss_bucket;
+   else
+   error = EINVAL;
break;
 #endif
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r267896 - head/sys/sys

2014-06-25 Thread Davide Italiano
Author: davide
Date: Thu Jun 26 05:23:48 2014
New Revision: 267896
URL: http://svnweb.freebsd.org/changeset/base/267896

Log:
  Improve r264388 removing namespace pollution previously introduced in
  . INT64_MAX actually requires __INT64_C() hack to get the
  type right on exotic architectures (e.g. on ones with 63-bit ints or long
  0x7fff is unsigned int or long). The hardcoded LL suffix is
  good enough to avoid these problems for SBT_MAX (it makes the type always
  signed long long, without overflow since long long has at least 64 bits).
  Many thanks to Bruce Evans for the time spent me to explain this.
  
  Reported by:  bde
  Reviewed by:  bde

Modified:
  head/sys/sys/time.h

Modified: head/sys/sys/time.h
==
--- head/sys/sys/time.h Thu Jun 26 04:12:41 2014(r267895)
+++ head/sys/sys/time.h Thu Jun 26 05:23:48 2014(r267896)
@@ -129,7 +129,7 @@ bintime_shift(struct bintime *_bt, int _
 #defineSBT_1MS (SBT_1S / 1000)
 #defineSBT_1US (SBT_1S / 100)
 #defineSBT_1NS (SBT_1S / 10)
-#defineSBT_MAX INT64_MAX
+#defineSBT_MAX 0x7fffLL
 
 static __inline int
 sbintime_getsec(sbintime_t _sbt)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r267897 - in head: contrib/file contrib/file/Magdir contrib/file/doc contrib/file/m4 contrib/file/magic contrib/file/python contrib/file/src contrib/file/tests lib/libmagic usr.bin/file

2014-06-25 Thread Xin LI
Author: delphij
Date: Thu Jun 26 06:03:39 2014
New Revision: 267897
URL: http://svnweb.freebsd.org/changeset/base/267897

Log:
  MFV r267843: update file/libmagic to 5.19.
  
  MFC after:2 weeks

Added:
  head/contrib/file/config.guess
 - copied unchanged from r267843, vendor/file/dist/config.guess
  head/contrib/file/config.sub
 - copied unchanged from r267843, vendor/file/dist/config.sub
  head/contrib/file/depcomp
 - copied unchanged from r267843, vendor/file/dist/depcomp
  head/contrib/file/doc/
 - copied from r267843, vendor/file/dist/doc/
  head/contrib/file/ltmain.sh
 - copied unchanged from r267843, vendor/file/dist/ltmain.sh
  head/contrib/file/m4/
 - copied from r267843, vendor/file/dist/m4/
  head/contrib/file/magic/
 - copied from r267843, vendor/file/dist/magic/
  head/contrib/file/missing
 - copied unchanged from r267843, vendor/file/dist/missing
  head/contrib/file/python/
 - copied from r267843, vendor/file/dist/python/
  head/contrib/file/src/
 - copied from r267843, vendor/file/dist/src/
  head/contrib/file/tests/escapevel.result
 - copied unchanged from r267843, vendor/file/dist/tests/escapevel.result
  head/contrib/file/tests/escapevel.testfile
 - copied unchanged from r267843, vendor/file/dist/tests/escapevel.testfile
  head/contrib/file/tests/issue311docx.result
 - copied unchanged from r267843, vendor/file/dist/tests/issue311docx.result
  head/contrib/file/tests/issue311docx.testfile
 - copied unchanged from r267843, 
vendor/file/dist/tests/issue311docx.testfile
Deleted:
  head/contrib/file/Header
  head/contrib/file/Localstuff
  head/contrib/file/Magdir/
  head/contrib/file/Makefile.am-src
  head/contrib/file/apprentice.c
  head/contrib/file/apptype.c
  head/contrib/file/ascmagic.c
  head/contrib/file/asprintf.c
  head/contrib/file/cdf.c
  head/contrib/file/cdf.h
  head/contrib/file/cdf_time.c
  head/contrib/file/compress.c
  head/contrib/file/elfclass.h
  head/contrib/file/encoding.c
  head/contrib/file/file.c
  head/contrib/file/file.h
  head/contrib/file/file.man
  head/contrib/file/file_opts.h
  head/contrib/file/fsmagic.c
  head/contrib/file/funcs.c
  head/contrib/file/getline.c
  head/contrib/file/getopt_long.c
  head/contrib/file/is_tar.c
  head/contrib/file/libmagic.man
  head/contrib/file/magic.c
  head/contrib/file/magic.h
  head/contrib/file/magic.man
  head/contrib/file/magic2mime
  head/contrib/file/mygetopt.h
  head/contrib/file/names.h
  head/contrib/file/print.c
  head/contrib/file/readcdf.c
  head/contrib/file/readelf.c
  head/contrib/file/readelf.h
  head/contrib/file/softmagic.c
  head/contrib/file/strlcat.c
  head/contrib/file/strlcpy.c
  head/contrib/file/tar.h
  head/contrib/file/tests/gedcom.magic
  head/contrib/file/vasprintf.c
Modified:
  head/contrib/file/ChangeLog
  head/contrib/file/Makefile.am
  head/contrib/file/Makefile.in
  head/contrib/file/README
  head/contrib/file/TODO
  head/contrib/file/aclocal.m4
  head/contrib/file/compile
  head/contrib/file/config.h.in
  head/contrib/file/configure
  head/contrib/file/configure.ac
  head/contrib/file/install-sh
  head/contrib/file/src/apprentice.c
  head/contrib/file/tests/Makefile.am
  head/contrib/file/tests/Makefile.in
  head/contrib/file/tests/README
  head/contrib/file/tests/gedcom.result
  head/lib/libmagic/Makefile
  head/lib/libmagic/config.h
  head/usr.bin/file/Makefile
Directory Properties:
  head/contrib/file/   (props changed)

Modified: head/contrib/file/ChangeLog
==
--- head/contrib/file/ChangeLog Thu Jun 26 05:23:48 2014(r267896)
+++ head/contrib/file/ChangeLog Thu Jun 26 06:03:39 2014(r267897)
@@ -1,3 +1,245 @@
+2014-06-12  12:28  Christos Zoulas 
+
+   * release 5.19
+
+2014-06-09   9:04  Christos Zoulas 
+   
+   * Misc buffer overruns and missing buffer size tests in cdf parsing
+ (Francisco Alonso, Jan Kaluza)
+
+2014-06-02  14:50  Christos Zoulas 
+
+   * Enforce limit of 8K on regex searches that have no limits
+   * Allow the l modifier for regex to mean line count. Default
+ to byte count. If line count is specified, assume a max
+ of 80 characters per line to limit the byte count.
+   * Don't allow conversions to be used for dates, allowing
+ the mask field to be used as an offset.
+
+2014-05-30  12:51  Christos Zoulas 
+
+   * Make the range operator limit the length of the
+ regex search.
+
+2014-05-14  19:23  Christos Zoulas 
+
+   * PR/347: Windows fixes
+   * PR/352: Hangul word processor recognition
+   * PR/354: Encoding irregularities in text files
+
+2014-05-06  6:12  Christos Zoulas 
+
+   * Fix uninitialized title in CDF files (Jan Kaluza)
+
+2014-05-04  14:55  Christos Zoulas 
+
+   * PR/351: Fix compilation of empty files 
+
+2014-04-30  17:39  Christos Zoulas 
+
+   * Fix integer formats: We don't specify 'l' or
+ 'h' and