svn commit: r270836 - head/etc/rc.d

2014-08-30 Thread Hiroki Sato
Author: hrs
Date: Sat Aug 30 07:08:10 2014
New Revision: 270836
URL: http://svnweb.freebsd.org/changeset/base/270836

Log:
  Use ipv6_prefer when at least one ifconfig_IF_ipv6 is configured.
  
  Discussed on: -net@

Modified:
  head/etc/rc.d/ip6addrctl

Modified: head/etc/rc.d/ip6addrctl
==
--- head/etc/rc.d/ip6addrctlSat Aug 30 03:41:47 2014(r270835)
+++ head/etc/rc.d/ip6addrctlSat Aug 30 07:08:10 2014(r270836)
@@ -75,6 +75,8 @@ ip6addrctl_start()
else
if checkyesno ipv6_activate_all_interfaces; then
ip6addrctl_prefer_ipv6
+   elif [ -n $(list_vars ifconfig_\*_ipv6) ]; then
+   ip6addrctl_prefer_ipv6
else
ip6addrctl_prefer_ipv4
fi
___
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: r270842 - in head: share/man/man4 sys/conf

2014-08-30 Thread Christian Brueffer
Author: brueffer
Date: Sat Aug 30 13:47:05 2014
New Revision: 270842
URL: http://svnweb.freebsd.org/changeset/base/270842

Log:
  Allow the iwn(4) fw 100 to be compiled into the kernel and update the
  relevant manpages.

Modified:
  head/share/man/man4/iwn.4
  head/share/man/man4/iwnfw.4
  head/sys/conf/files

Modified: head/share/man/man4/iwn.4
==
--- head/share/man/man4/iwn.4   Sat Aug 30 13:28:10 2014(r270841)
+++ head/share/man/man4/iwn.4   Sat Aug 30 13:47:05 2014(r270842)
@@ -25,7 +25,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd August 14, 2014
+.Dd August 30, 2014
 .Dt IWN 4
 .Os
 .Sh NAME
@@ -46,6 +46,7 @@ You also need to select a firmware for y
 Choose one from:
 .Bd -ragged -offset indent
 .Cd device iwn1000fw
+.Cd device iwn100fw
 .Cd device iwn105fw
 .Cd device iwn135fw
 .Cd device iwn2000fw
@@ -72,6 +73,7 @@ module at boot time, place the following
 .Bd -literal -offset indent
 if_iwn_load=YES
 iwn1000fw_load=YES
+iwn100fw_load=YES
 iwn105fw_load=YES
 iwn135fw_load=YES
 iwn2000fw_load=YES

Modified: head/share/man/man4/iwnfw.4
==
--- head/share/man/man4/iwnfw.4 Sat Aug 30 13:28:10 2014(r270841)
+++ head/share/man/man4/iwnfw.4 Sat Aug 30 13:47:05 2014(r270842)
@@ -22,7 +22,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd August 14, 2014
+.Dd August 30, 2014
 .Dt IWNFW 4
 .Os
 .Sh NAME
@@ -43,6 +43,7 @@ If you want to pick only the firmware im
 of the following:
 .Bd -ragged -offset indent
 .Cd device iwn1000fw
+.Cd device iwn100fw
 .Cd device iwn105fw
 .Cd device iwn135fw
 .Cd device iwn2000fw
@@ -61,6 +62,7 @@ module at boot time, place the following
 .Xr loader.conf 5 :
 .Bd -literal -offset indent
 iwn1000fw_load=YES
+iwn100fw_load=YES
 iwn105fw_load=YES
 iwn135fw_load=YES
 iwn2000fw_load=YES
@@ -75,7 +77,7 @@ iwn6050fw_load=YES
 .Ed
 .Sh DESCRIPTION
 This module provides access to firmware sets for the
-Intel Wireless WiFi Link 105, 135, 1000, 2000, 2030, 4965, 5000 and 6000 
series of
+Intel Wireless WiFi Link 100, 105, 135, 1000, 2000, 2030, 4965, 5000 and 6000 
series of
 IEEE 802.11n adapters.
 It may be
 statically linked into the kernel, or loaded as a module.

Modified: head/sys/conf/files
==
--- head/sys/conf/files Sat Aug 30 13:28:10 2014(r270841)
+++ head/sys/conf/files Sat Aug 30 13:47:05 2014(r270842)
@@ -1602,6 +1602,20 @@ iwn1000.fw   optional iwn1000fw | 
iwnfw  
compile-with${NORMAL_FW}  \
no-obj no-implicit-rule \
clean   iwn1000.fw
+iwn100fw.c optional iwn100fw | iwnfw   \
+   compile-with${AWK} -f $S/tools/fw_stub.awk iwn100.fw:iwn100fw 
-miwn100fw -c${.TARGET} \
+   no-implicit-rule before-depend local\
+   clean   iwn100fw.c
+iwn100fw.fwo   optional iwn100fw | iwnfw   \
+   dependency  iwn100.fw \
+   compile-with${NORMAL_FWO} \
+   no-implicit-rule\
+   clean   iwn100fw.fwo
+iwn100.fw  optional iwn100fw | iwnfw   \
+   dependency  $S/contrib/dev/iwn/iwlwifi-100-39.31.5.1.fw.uu \
+   compile-with${NORMAL_FW}  \
+   no-obj no-implicit-rule \
+   clean   iwn100.fw
 iwn105fw.c optional iwn105fw | iwnfw   \
compile-with${AWK} -f $S/tools/fw_stub.awk iwn105.fw:iwn105fw 
-miwn105fw -c${.TARGET} \
no-implicit-rule before-depend local\
___
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: r270845 - head/lib/msun/src

2014-08-30 Thread Steve Kargl
Author: kargl
Date: Sat Aug 30 17:14:47 2014
New Revision: 270845
URL: http://svnweb.freebsd.org/changeset/base/270845

Log:
  Make tiny volatile to prevent the compiler(s) from
  constant folding expressions of the form 1 - tiny,
  which are used to raise FE_INEXACT.

Modified:
  head/lib/msun/src/s_tanh.c
  head/lib/msun/src/s_tanhf.c

Modified: head/lib/msun/src/s_tanh.c
==
--- head/lib/msun/src/s_tanh.c  Sat Aug 30 15:41:07 2014(r270844)
+++ head/lib/msun/src/s_tanh.c  Sat Aug 30 17:14:47 2014(r270845)
@@ -42,7 +42,8 @@ __FBSDID($FreeBSD$);
 #include math.h
 #include math_private.h
 
-static const double one = 1.0, two = 2.0, tiny = 1.0e-300, huge = 1.0e300;
+static volatile const double tiny = 1.0e-300;
+static const double one = 1.0, two = 2.0, huge = 1.0e300;
 
 double
 tanh(double x)

Modified: head/lib/msun/src/s_tanhf.c
==
--- head/lib/msun/src/s_tanhf.c Sat Aug 30 15:41:07 2014(r270844)
+++ head/lib/msun/src/s_tanhf.c Sat Aug 30 17:14:47 2014(r270845)
@@ -19,7 +19,9 @@ __FBSDID($FreeBSD$);
 #include math.h
 #include math_private.h
 
-static const float one=1.0, two=2.0, tiny = 1.0e-30, huge = 1.0e30;
+static volatile const float tiny = 1.0e-30;
+static const float one=1.0, two=2.0, huge = 1.0e30;
+
 float
 tanhf(float x)
 {
___
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: r270847 - head/lib/msun/src

2014-08-30 Thread Steve Kargl
Author: kargl
Date: Sat Aug 30 17:31:53 2014
New Revision: 270847
URL: http://svnweb.freebsd.org/changeset/base/270847

Log:
  Fix the order of const volatile to be consistent with
  the rest of msun.

Modified:
  head/lib/msun/src/s_tanh.c
  head/lib/msun/src/s_tanhf.c

Modified: head/lib/msun/src/s_tanh.c
==
--- head/lib/msun/src/s_tanh.c  Sat Aug 30 17:18:11 2014(r270846)
+++ head/lib/msun/src/s_tanh.c  Sat Aug 30 17:31:53 2014(r270847)
@@ -42,7 +42,7 @@ __FBSDID($FreeBSD$);
 #include math.h
 #include math_private.h
 
-static volatile const double tiny = 1.0e-300;
+static const volatile double tiny = 1.0e-300;
 static const double one = 1.0, two = 2.0, huge = 1.0e300;
 
 double

Modified: head/lib/msun/src/s_tanhf.c
==
--- head/lib/msun/src/s_tanhf.c Sat Aug 30 17:18:11 2014(r270846)
+++ head/lib/msun/src/s_tanhf.c Sat Aug 30 17:31:53 2014(r270847)
@@ -19,7 +19,7 @@ __FBSDID($FreeBSD$);
 #include math.h
 #include math_private.h
 
-static volatile const float tiny = 1.0e-30;
+static const volatile float tiny = 1.0e-30;
 static const float one=1.0, two=2.0, huge = 1.0e30;
 
 float
___
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: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm

2014-08-30 Thread Peter Wemm
On Saturday 30 August 2014 02:03:42 Steven Hartland wrote:
 - Original Message -
 From: Peter Wemm pe...@wemm.org
 
  On Friday 29 August 2014 21:42:15 Steven Hartland wrote:

 
  If this function returns non-zerp, ARC is given back:
  
  static int
  arc_reclaim_needed(void)
  {
  
  if (kmem_free_count()  zfs_arc_free_target) {
  
  return (1);
  
  }
  
   /*
   * Cooperate with pagedaemon when it's time for it to scan
   * and reclaim some pages.
   */
  
  if (vm_paging_needed()) {
  
  return (1);
  
  }
  
  ie: if v_free (ignoring v_cache free pages) gets below the threshold,
  stop
  evertyhing and discard ARC pages.
  
  The vm_paging_needed() code is a NO-OP at this point. It can never
  return
  
  true.  Consider:
  vm_cnt.v_free_target = 4 * vm_cnt.v_free_min +
  
  vm_cnt.v_free_reserved;
  vs
  
  vm_pageout_wakeup_thresh = (vm_cnt.v_free_min / 10) * 11;
  
  zfs_arc_free_target defaults to vm_cnt.v_free_target, which is 400% of
  v_free_min, and compares it against the smaller v_free pool.
  
  vm_paging_needed() compares the total free pool (v_free + v_cache)
  against the
  smaller wakeup threshold - 110% of v_free_min.
  
  Comparing a larger value against a smaller target than the previous
  test will
  never succeed unless you manually change the arc_free_target sysctl.
 
 I'm aware of the values involved, and as I said what you're proposing
 was more akin to where I started, but I was informed that it had already
 been tested and didn't work well.

And Karl also said that his tests are on machines that have no v_cache, so 
he's not testing the scenario.

The code, as written, is wrong.  It's as simple as that.

The logic is wrong.

You've introduced dead code.

Your code changes introduce a scenario that CAUSES one of the very problems 
you're using as a justtification for the changes.

Your own testers have admitted that they don't test the scenario that the 
problem exists with.

  Also, what about the magic numbers here:
  u_int zfs_arc_free_target = (1  19); /* default before pagedaemon
  init only */
 
 That is just a total fall back case and should never be triggered unless
 as the comment states the pagedaemon isn't initialised.
 
  That's half a million pages, or 2GB of physical ram on a 4K page size
  system
  How is this going to work on early boot in the machines in the cluster
  with
  less than 2GB of ram?
 
 Its there to ensure that ARC doesn't run wild ARC for the few
 milliseconds
 / seconds before pagedaemon is initalised.
 
 We can change the value no problem, what would you suggest 116 aka
 256MB?

Please stop picking magic numbers out of thin air.  You are working with file 
system and VM - critical parts of the system.  This is NOT the place to be 
screwing around with things you don't understand.  alc@ was trying to be 
polite.

 Thanks for all the feedback, its great to have my understanding of
 how things work in this area confirmed by those who know.

 Hopefully we'll be able to get to the bottom of this with everyones
 help and get a solid fix for these issues that have plaged 10 into
 10.1 :)

I'm very disappointed in the attention to detail and errors in the commit.  
I'm almost at the point where I want to ask for the whole thing to be backed 
out.

-- 
Peter Wemm - pe...@wemm.org; pe...@freebsd.org; pe...@yahoo-inc.com; KI6FJV
UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246

signature.asc
Description: This is a digitally signed message part.


Re: svn commit: r270829 - head/sys/kern

2014-08-30 Thread John Baldwin
On Friday, August 29, 2014 09:50:32 PM Andreas Tobler wrote:
 Author: andreast
 Date: Fri Aug 29 21:50:32 2014
 New Revision: 270829
 URL: http://svnweb.freebsd.org/changeset/base/270829
 
 Log:
   Rename shm_dict_init to shm_init to fix a compiler warning.
 
   Reviewed by:jhb

Thanks!

-- 
John Baldwin
___
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: r270854 - head/sys/dev/bktr

2014-08-30 Thread Gavin Atkinson
Author: gavin
Date: Sat Aug 30 18:01:45 2014
New Revision: 270854
URL: http://svnweb.freebsd.org/changeset/base/270854

Log:
  Replace cvsweb link wihg svnweb URL in bktr(4) release notes.

Modified:
  head/sys/dev/bktr/CHANGELOG.TXT

Modified: head/sys/dev/bktr/CHANGELOG.TXT
==
--- head/sys/dev/bktr/CHANGELOG.TXT Sat Aug 30 18:01:36 2014
(r270853)
+++ head/sys/dev/bktr/CHANGELOG.TXT Sat Aug 30 18:01:45 2014
(r270854)
@@ -515,5 +515,5 @@
   support for audio on Hauppauge cards without the audio mux.
   The MSP is used for audio selection. (the 44xxx models)
 
-[see http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/bktr/
+[see https://svnweb.freebsd.org/base/head/sys/dev/bktr/
 for newer change logs ]
___
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: r270850 - in head/sys: i386/i386 i386/include i386/isa x86/acpica

2014-08-30 Thread Alexey Dokuchaev
On Sat, Aug 30, 2014 at 01:58:20PM -0400, John Baldwin wrote:
 On Saturday, August 30, 2014 05:48:38 PM John Baldwin wrote:
  New Revision: 270850
  URL: http://svnweb.freebsd.org/changeset/base/270850
  
  Log:
Save and restore FPU state across suspend and resume.  In earlier
  revisions of this patch, resumectx() called npxresume() directly, but that
  doesn't work because resumectx() runs with a non-standard %cs selector.
  Instead, all of the FPU suspend/resume handling is done in C.
 
 This mostly fixes suspend and resume in X on a little 32-bit only netbook I
 have.  I needed an additional patch to the i915 code to prevent it from
 tearing down its interrupt handler in suspend and re-establishing it during
 resume (this sort of thing is not needed in drivers and isn't safe because
 suspend runs pinned to CPU 0 and unregistering an interrupt needs to bind to
 the CPU the IDT vector is assigned to).

John, thanks for a lot for making more and more laptops sleep-ready, as this
will certainly help FreeBSD to be considered as a suitable platform for them.

./danfe
___
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: r270855 - head/usr.sbin/bhyve

2014-08-30 Thread Neel Natu
Author: neel
Date: Sat Aug 30 18:35:16 2014
New Revision: 270855
URL: http://svnweb.freebsd.org/changeset/base/270855

Log:
  Set the 'inst_length' to '0' early on before any error conditions are detected
  in the emulation of the task switch. If any exceptions are triggered then the
  guest %rip should point to instruction that caused the task switch as opposed
  to the one after it.

Modified:
  head/usr.sbin/bhyve/task_switch.c

Modified: head/usr.sbin/bhyve/task_switch.c
==
--- head/usr.sbin/bhyve/task_switch.c   Sat Aug 30 18:01:45 2014
(r270854)
+++ head/usr.sbin/bhyve/task_switch.c   Sat Aug 30 18:35:16 2014
(r270855)
@@ -725,6 +725,21 @@ vmexit_task_switch(struct vmctx *ctx, st
assert(paging-cpu_mode == CPU_MODE_PROTECTED);
 
/*
+* Calculate the %eip to store in the old TSS before modifying the
+* 'inst_length'.
+*/
+   eip = vmexit-rip + vmexit-inst_length;
+
+   /*
+* Set the 'inst_length' to '0'.
+*
+* If an exception is triggered during emulation of the task switch
+* then the exception handler should return to the instruction that
+* caused the task switch as opposed to the subsequent instruction.
+*/
+   vmexit-inst_length = 0;
+
+   /*
 * Section 4.6, Access Rights in Intel SDM Vol 3.
 * The following page table accesses are implicitly supervisor mode:
 * - accesses to GDT or LDT to load segment descriptors
@@ -839,7 +854,6 @@ vmexit_task_switch(struct vmctx *ctx, st
}
 
/* Save processor state in old TSS */
-   eip = vmexit-rip + vmexit-inst_length;
tss32_save(ctx, vcpu, task_switch, eip, oldtss, ot_iov);
 
/*
@@ -870,7 +884,7 @@ vmexit_task_switch(struct vmctx *ctx, st
 * the saved instruction pointer will belong to the new task.
 */
vmexit-rip = newtss.tss_eip;
-   vmexit-inst_length = 0;
+   assert(vmexit-inst_length == 0);
 
/* Load processor state from new TSS */
error = tss32_restore(ctx, vcpu, task_switch, ot_sel, newtss, nt_iov);
___
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: r270850 - in head/sys: i386/i386 i386/include i386/isa x86/acpica

2014-08-30 Thread Adrian Chadd
On 30 August 2014 10:58, John Baldwin j...@freebsd.org wrote:
 On Saturday, August 30, 2014 05:48:38 PM John Baldwin wrote:
 Author: jhb
 Date: Sat Aug 30 17:48:38 2014
 New Revision: 270850
 URL: http://svnweb.freebsd.org/changeset/base/270850

 Log:
   Save and restore FPU state across suspend and resume.  In earlier
 revisions of this patch, resumectx() called npxresume() directly, but that
 doesn't work because resumectx() runs with a non-standard %cs selector.
 Instead, all of the FPU suspend/resume handling is done in C.

 This mostly fixes suspend and resume in X on a little 32-bit only netbook I
 have.  I needed an additional patch to the i915 code to prevent it from
 tearing down its interrupt handler in suspend and re-establishing it during
 resume (this sort of thing is not needed in drivers and isn't safe because
 suspend runs pinned to CPU 0 and unregistering an interrupt needs to bind to
 the CPU the IDT vector is assigned to).

 --- //depot/vendor/freebsd/src/sys/dev/drm2/i915/i915_drv.c
 +++ //depot/user/jhb/acpipci/dev/drm2/i915/i915_drv.c
 @@ -253,7 +253,9 @@
 GEM idle failed, resume might fail\n);
 return (error);
 }
 +#if 0
 drm_irq_uninstall(dev);
 +#endif
 }

 i915_save_state(dev);
 @@ -315,7 +317,9 @@
 sx_xlock(dev-mode_config.mutex);
 drm_mode_config_reset(dev);
 sx_xunlock(dev-mode_config.mutex);
 +#if 0
 drm_irq_install(dev);
 +#endif

 sx_xlock(dev-mode_config.mutex);
 /* Resume the modeset for every activated CRTC */

 Even with that my one attempt at resuming in X so far seemed to hang in X
 (though the machine was fine and worked fine aside from X hanging).

 Curiously, this netbook is able to suspend/resume just fine on the console
 with syscons(4), but the LCD is not turned back on if I suspend/resume with
 vt(4) using the VGA driver.  I think vt(4) should do some of the VESA stuff
 for suspend/resume syscons does when using vt_vga (but not when using one of
 the KMS backends).

Hm, can you file the DRM patch to get reviewed and put into the tree?
That's a good catch.

As for vt(4) + VESA - yeah, I think we may have to write VESA
extensions for vt_vga, or write vt_vga_vesa. It's sorely lacking. :(


-a
___
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: r270803 - head/libexec/rtld-elf

2014-08-30 Thread Konstantin Belousov
On Fri, Aug 29, 2014 at 02:45:55PM -0500, Bryan Drewery wrote:
 My only uses so far have been observing which file is loaded for a
 library with dlopen(3) and where symbols are resolved from. Seeing where
 symbols are resolved from is useful for both dlopen(3)/dlsym(3) usage
 and LD_PRELOAD.
Ok.

Note that there are no traces of why the symbols where resolved from
the specified object, and, why that symbol was selected (one object
may contain several symbols with the same name, for several reasons).

 
 I've written an application that optionally allows using some
 libraries such as libtcl to be used without requiring the library at
 build time or startup. At build time the library's headers are used to
 generate wrapper functions for every symbol needed. The library is not
 linked in. When the binary is ran it starts up fine if libtcl is
 missing. At runtime if TCL is enabled then it will attempt to
 dlopen(libtcl.so.VER) using the VER its symbols was compiled against. If
 it cannot find it then the feature is disabled. It uses dlsym(3) to load
 all symbols into a table and the wrapper functions use that table via
 hash table lookups.
Note that ELF PLT symbols (i.e. function call sites) resolution is lazy
by default, i.e. the only tricky part to do for this with the standard
tools is to avoid writing the DT_NEEDED tag into the binary you construct.

Newer GNU ld has interesting options like --unresolved-symbols=ignore-all,
or --warn-unresolved-symbols, which seemingly allow to link the binary
even with unresolved symbols.

If you use then dlopen(libname, RTLD_LAZY | RTLD_GLOBAL) before calling
the functions from the library, you should get what you want without
needing to laborously provide stubs and use dlsym().

And, this cannot work for non-PLT relocations, e.g. references to global
variables.

 
 This all pretty convoluted and only done to avoid requiring a library at
 startup. The application is distributed pre-compiled for specific OS
 releases and not intended to be compiled manually.
 
 Anyway some examples from GNU's rtld:
 
  # env LD_DEBUG=help ./app
  Valid options for the LD_DEBUG environment variable are:
  
libsdisplay library search paths
reloc   display relocation processing
files   display progress for input file
symbols display symbol table processing
bindingsdisplay information about symbol binding
versionsdisplay version dependencies
all all previous options combined
statistics  display relocation statistics
unused  determined unused DSOs
helpdisplay this help message and exit
  
  To direct the debugging output into a file instead of standard output
  a filename can be specified using the LD_DEBUG_OUTPUT environment variable.
 
 With libs:
 
  # env LD_DEBUG=libs ./app
  ...
9328: find library=libtcl.so [0]; searching
9328:  search cache=/etc/ld.so.cache
9328:  search 
  path=/lib64/tls/x86_64:/lib64/tls:/lib64/x86_64:/lib64:/usr/lib64/tls/x86_64:/usr/lib64/tls:/usr/lib64/x86_64:/usr/lib64
  (system search path)
9328:   trying file=/lib64/tls/x86_64/libtcl.so
9328:   trying file=/lib64/tls/libtcl.so
9328:   trying file=/lib64/x86_64/libtcl.so
9328:   trying file=/lib64/libtcl.so
9328:   trying file=/usr/lib64/tls/x86_64/libtcl.so
9328:   trying file=/usr/lib64/tls/libtcl.so
9328:   trying file=/usr/lib64/x86_64/libtcl.so
9328:   trying file=/usr/lib64/libtcl.so
9328:
9328: find library=libpthread.so.0 [0]; searching
9328:  search path=/usr/lib64 (system search path)
9328:   trying file=/usr/lib64/libpthread.so.0
9328:  search cache=/etc/ld.so.cache
9328:   trying file=/lib64/libpthread.so.0
9328:
9328:
9328: calling init: /lib64/libpthread.so.0
9328:
9328:
9328: calling init: /usr/lib64/libtcl.so
9328:
9328: find library=libnss_compat.so.2 [0]; searching
9328:  search cache=/etc/ld.so.cache
9328:   trying file=/lib64/libnss_compat.so.2
9328:
9328: find library=libnsl.so.1 [0]; searching
9328:  search cache=/etc/ld.so.cache
9328:   trying file=/lib64/libnsl.so.1
9328:
9328:
9328: calling init: /lib64/libnsl.so.1
9328:
9328:
9328: calling init: /lib64/libnss_compat.so.2
9328:
9328: find library=libnss_nis.so.2 [0]; searching
9328:  search cache=/etc/ld.so.cache
9328:   trying file=/lib64/libnss_nis.so.2
9328:
9328: find library=libnss_files.so.2 [0]; searching
9328:  search cache=/etc/ld.so.cache
9328:   trying file=/lib64/libnss_files.so.2
9328:
9328:
9328: calling 

Re: svn commit: r270759 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs vm

2014-08-30 Thread Steven Hartland
- Original Message - 
From: Peter Wemm pe...@wemm.org

snip...
 I'm aware of the values involved, and as I said what you're 
 proposing
 was more akin to where I started, but I was informed that it had 
 already

 been tested and didn't work well.

And Karl also said that his tests are on machines that have no 
v_cache, so

he's not testing the scenario.

The code, as written, is wrong.  It's as simple as that.

The logic is wrong.

You've introduced dead code.

Your code changes introduce a scenario that CAUSES one of the very 
problems

you're using as a justtification for the changes.

Your own testers have admitted that they don't test the scenario that 
the

problem exists with.


Wooo hold on there, I'm trying to react to feedback and come to a proper
solution. I've already said that my initial version was very much like 
what
I believe your requesting its changed to, but I reacted to feedback on 
that.


Now if that feedback was inaccurate or miss-guided I'm sorry, and I'm
thankfull for your input as the domain expert.

The PR was created quite some time ago, and it wasn't till I encountered 
a
related issue in a live system the other weekend that it got some 
attention.


Its clearly an important issue that needs resolving so lets work 
together

to come up with a fix everyones happy with.


  Also, what about the magic numbers here:
  u_int zfs_arc_free_target = (1  19); /* default before 
  pagedaemon

  init only */

 That is just a total fall back case and should never be triggered 
 unless

 as the comment states the pagedaemon isn't initialised.

  That's half a million pages, or 2GB of physical ram on a 4K page 
  size

  system
  How is this going to work on early boot in the machines in the 
  cluster

  with
  less than 2GB of ram?

 Its there to ensure that ARC doesn't run wild ARC for the few
 milliseconds
 / seconds before pagedaemon is initalised.

 We can change the value no problem, what would you suggest 116 aka
 256MB?

Please stop picking magic numbers out of thin air.  You are working 
with file
system and VM - critical parts of the system.  This is NOT the place 
to be
screwing around with things you don't understand.  alc@ was trying to 
be

polite.


Please help me out here, I'm trying to do the right thing so I'm looking
to you guys for advice.


 Thanks for all the feedback, its great to have my understanding of
 how things work in this area confirmed by those who know.

 Hopefully we'll be able to get to the bottom of this with everyones
 help and get a solid fix for these issues that have plaged 10 into
 10.1 :)

I'm very disappointed in the attention to detail and errors in the 
commit.
I'm almost at the point where I want to ask for the whole thing to be 
backed

out.


I'm not disagreeing with anyone, I'm simply trying to accure the 
information
on how to update this that will result in the best for users, so 
sweeping

statements like this just make me feel bad for trying to help :(

I'm more than happy to address any concerns people have.

I've kicked this off with a webrev https://reviews.freebsd.org/D700

   Regards
   Steve 


___
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: r270856 - in head/sys: dev/ae dev/age dev/alc dev/ale dev/altera/atse dev/bfe dev/cas dev/dc dev/e1000 dev/ffec dev/firewire dev/gem dev/gxemul/ether dev/hme dev/hyperv/netvsc dev/ixgb ...

2014-08-30 Thread Gleb Smirnoff
Author: glebius
Date: Sat Aug 30 19:55:54 2014
New Revision: 270856
URL: http://svnweb.freebsd.org/changeset/base/270856

Log:
  Use define from if_var.h to access a field inside struct if_data,
  that resides in struct ifnet.
  
  Sponsored by: Nginx, Inc.

Modified:
  head/sys/dev/ae/if_ae.c
  head/sys/dev/age/if_age.c
  head/sys/dev/alc/if_alc.c
  head/sys/dev/ale/if_ale.c
  head/sys/dev/altera/atse/if_atse.c
  head/sys/dev/bfe/if_bfe.c
  head/sys/dev/cas/if_cas.c
  head/sys/dev/dc/if_dc.c
  head/sys/dev/e1000/if_igb.c
  head/sys/dev/ffec/if_ffec.c
  head/sys/dev/firewire/if_fwe.c
  head/sys/dev/gem/if_gem.c
  head/sys/dev/gxemul/ether/if_gx.c
  head/sys/dev/hme/if_hme.c
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
  head/sys/dev/ixgb/if_ixgb.c
  head/sys/dev/ixgbe/ixgbe.c
  head/sys/dev/ixgbe/ixv.c
  head/sys/dev/ixl/if_ixl.c
  head/sys/dev/ixl/if_ixlv.c
  head/sys/dev/jme/if_jme.c
  head/sys/dev/le/lance.c
  head/sys/dev/msk/if_msk.c
  head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c
  head/sys/dev/nge/if_nge.c
  head/sys/dev/qlxgb/qla_os.c
  head/sys/dev/qlxgbe/ql_os.c
  head/sys/dev/qlxge/qls_os.c
  head/sys/dev/re/if_re.c
  head/sys/dev/rt/if_rt.c
  head/sys/dev/sf/if_sf.c
  head/sys/dev/sge/if_sge.c
  head/sys/dev/sis/if_sis.c
  head/sys/dev/sk/if_sk.c
  head/sys/dev/ste/if_ste.c
  head/sys/dev/stge/if_stge.c
  head/sys/dev/txp/if_txp.c
  head/sys/dev/vge/if_vge.c
  head/sys/dev/virtio/network/if_vtnet.c
  head/sys/dev/vr/if_vr.c
  head/sys/dev/vxge/vxge.c
  head/sys/mips/cavium/if_octm.c
  head/sys/mips/cavium/octe/octe.c

Modified: head/sys/dev/ae/if_ae.c
==
--- head/sys/dev/ae/if_ae.c Sat Aug 30 18:35:16 2014(r270855)
+++ head/sys/dev/ae/if_ae.c Sat Aug 30 19:55:54 2014(r270856)
@@ -363,7 +363,7 @@ ae_attach(device_t dev)
 
ether_ifattach(ifp, sc-eaddr);
/* Tell the upper layer(s) we support long frames. */
-   ifp-if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
+   ifp-if_hdrlen = sizeof(struct ether_vlan_header);
 
/*
 * Create and run all helper tasks.

Modified: head/sys/dev/age/if_age.c
==
--- head/sys/dev/age/if_age.c   Sat Aug 30 18:35:16 2014(r270855)
+++ head/sys/dev/age/if_age.c   Sat Aug 30 19:55:54 2014(r270856)
@@ -635,7 +635,7 @@ age_attach(device_t dev)
ifp-if_capenable = ifp-if_capabilities;
 
/* Tell the upper layer(s) we support long frames. */
-   ifp-if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
+   ifp-if_hdrlen = sizeof(struct ether_vlan_header);
 
/* Create local taskq. */
sc-age_tq = taskqueue_create_fast(age_taskq, M_WAITOK,

Modified: head/sys/dev/alc/if_alc.c
==
--- head/sys/dev/alc/if_alc.c   Sat Aug 30 18:35:16 2014(r270855)
+++ head/sys/dev/alc/if_alc.c   Sat Aug 30 19:55:54 2014(r270856)
@@ -1012,7 +1012,7 @@ alc_attach(device_t dev)
ifp-if_hwassist = ~ALC_CSUM_FEATURES;
 
/* Tell the upper layer(s) we support long frames. */
-   ifp-if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
+   ifp-if_hdrlen = sizeof(struct ether_vlan_header);
 
/* Create local taskq. */
sc-alc_tq = taskqueue_create_fast(alc_taskq, M_WAITOK,

Modified: head/sys/dev/ale/if_ale.c
==
--- head/sys/dev/ale/if_ale.c   Sat Aug 30 18:35:16 2014(r270855)
+++ head/sys/dev/ale/if_ale.c   Sat Aug 30 19:55:54 2014(r270856)
@@ -658,7 +658,7 @@ ale_attach(device_t dev)
ifp-if_capenable = ~IFCAP_RXCSUM;
 
/* Tell the upper layer(s) we support long frames. */
-   ifp-if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
+   ifp-if_hdrlen = sizeof(struct ether_vlan_header);
 
/* Create local taskq. */
sc-ale_tq = taskqueue_create_fast(ale_taskq, M_WAITOK,

Modified: head/sys/dev/altera/atse/if_atse.c
==
--- head/sys/dev/altera/atse/if_atse.c  Sat Aug 30 18:35:16 2014
(r270855)
+++ head/sys/dev/altera/atse/if_atse.c  Sat Aug 30 19:55:54 2014
(r270856)
@@ -1708,7 +1708,7 @@ atse_attach(device_t dev)
ether_ifattach(ifp, sc-atse_eth_addr);
 
/* Tell the upper layer(s) about vlan mtu support. */
-   ifp-if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
+   ifp-if_hdrlen = sizeof(struct ether_vlan_header);
ifp-if_capabilities |= IFCAP_VLAN_MTU;
ifp-if_capenable = ifp-if_capabilities;
 #ifdef DEVICE_POLLING

Modified: head/sys/dev/bfe/if_bfe.c
==
--- head/sys/dev/bfe/if_bfe.c   Sat Aug 30 18:35:16 2014(r270855)
+++ head/sys/dev/bfe/if_bfe.c   

Re: svn commit: r270850 - in head/sys: i386/i386 i386/include i386/isa x86/acpica

2014-08-30 Thread Konstantin Belousov
On Sat, Aug 30, 2014 at 05:48:38PM +, John Baldwin wrote:
 Author: jhb
 Date: Sat Aug 30 17:48:38 2014
 New Revision: 270850
 URL: http://svnweb.freebsd.org/changeset/base/270850
 
 Log:
   Save and restore FPU state across suspend and resume.  In earlier revisions
   of this patch, resumectx() called npxresume() directly, but that doesn't
   work because resumectx() runs with a non-standard %cs selector.  Instead,
   all of the FPU suspend/resume handling is done in C.
   
   MFC after:  1 week
 
 Modified:
   head/sys/i386/i386/mp_machdep.c
   head/sys/i386/i386/swtch.s
   head/sys/i386/include/npx.h
   head/sys/i386/include/pcb.h
   head/sys/i386/isa/npx.c
   head/sys/x86/acpica/acpi_wakeup.c
 
 Modified: head/sys/i386/i386/mp_machdep.c
 ==
 --- head/sys/i386/i386/mp_machdep.c   Sat Aug 30 17:39:28 2014
 (r270849)
 +++ head/sys/i386/i386/mp_machdep.c   Sat Aug 30 17:48:38 2014
 (r270850)
 @@ -1522,9 +1522,15 @@ cpususpend_handler(void)
  
   cpu = PCPU_GET(cpuid);
   if (savectx(susppcbs[cpu])) {
 +#ifdef DEV_NPX
 + npxsuspend(suspcbs[cpu]-pcb_fpususpend);
 +#endif
   wbinvd();
   CPU_SET_ATOMIC(cpu, suspended_cpus);
   } else {
 +#ifdef DEV_NPX
 + npxresume(suspcbs[cpu]-pcb_fpususpend);
 +#endif
   pmap_init_pat();
   PCPU_SET(switchtime, 0);
   PCPU_SET(switchticks, ticks);
 
 Modified: head/sys/i386/i386/swtch.s
 ==
 --- head/sys/i386/i386/swtch.sSat Aug 30 17:39:28 2014
 (r270849)
 +++ head/sys/i386/i386/swtch.sSat Aug 30 17:48:38 2014
 (r270850)
 @@ -416,45 +416,6 @@ ENTRY(savectx)
   sldtPCB_LDT(%ecx)
   str PCB_TR(%ecx)
  
 -#ifdef DEV_NPX
 - /*
 -  * If fpcurthread == NULL, then the npx h/w state is irrelevant and the
 -  * state had better already be in the pcb.  This is true for forks
 -  * but not for dumps (the old book-keeping with FP flags in the pcb
 -  * always lost for dumps because the dump pcb has 0 flags).
 -  *
 -  * If fpcurthread != NULL, then we have to save the npx h/w state to
 -  * fpcurthread's pcb and copy it to the requested pcb, or save to the
 -  * requested pcb and reload.  Copying is easier because we would
 -  * have to handle h/w bugs for reloading.  We used to lose the
 -  * parent's npx state for forks by forgetting to reload.
 -  */
 - pushfl
 - CLI
 - movlPCPU(FPCURTHREAD),%eax
 - testl   %eax,%eax
 - je  1f
 -
 - pushl   %ecx
 - movlTD_PCB(%eax),%eax
 - movlPCB_SAVEFPU(%eax),%eax
 - pushl   %eax
 - pushl   %eax
 - callnpxsave
 - addl$4,%esp
 - popl%eax
 - popl%ecx
 -
 - pushl   $PCB_SAVEFPU_SIZE
 - lealPCB_USERFPU(%ecx),%ecx
 - pushl   %ecx
 - pushl   %eax
 - callbcopy
 - addl$12,%esp
 -1:
 - popfl
 -#endif   /* DEV_NPX */
 -
   movl$1,%eax
   ret
  END(savectx)
 @@ -519,10 +480,6 @@ ENTRY(resumectx)
   movlPCB_DR7(%ecx),%eax
   movl%eax,%dr7
  
 -#ifdef DEV_NPX
 - /* XXX FIX ME */
 -#endif
 -
   /* Restore other registers */
   movlPCB_EDI(%ecx),%edi
   movlPCB_ESI(%ecx),%esi
 
 Modified: head/sys/i386/include/npx.h
 ==
 --- head/sys/i386/include/npx.h   Sat Aug 30 17:39:28 2014
 (r270849)
 +++ head/sys/i386/include/npx.h   Sat Aug 30 17:48:38 2014
 (r270850)
 @@ -53,8 +53,10 @@ void   npxexit(struct thread *td);
  int  npxformat(void);
  int  npxgetregs(struct thread *td);
  void npxinit(void);
 +void npxresume(union savefpu *addr);
  void npxsave(union savefpu *addr);
  void npxsetregs(struct thread *td, union savefpu *addr);
 +void npxsuspend(union savefpu *addr);
  int  npxtrap_x87(void);
  int  npxtrap_sse(void);
  void npxuserinited(struct thread *);
 
 Modified: head/sys/i386/include/pcb.h
 ==
 --- head/sys/i386/include/pcb.h   Sat Aug 30 17:39:28 2014
 (r270849)
 +++ head/sys/i386/include/pcb.h   Sat Aug 30 17:48:38 2014
 (r270850)
 @@ -90,6 +90,8 @@ struct pcb {
   struct region_descriptor pcb_idt;
   uint16_tpcb_ldt;
   uint16_tpcb_tr;
 +
 + union   savefpu pcb_fpususpend;
  };
Now pcb consumes 512 bytes from each thread' kernel stack, which mostly
stay unused.

Amd64 only stores the pointer to the fpususpend context in pcb, and
acpu_wakeup() allocates the memory as needed. Even this is a waste of 8
bytes which are not needed for normal kernel operations.

Suspend FPU context, as well as amd64 MSRs should go out of pcb into
some per-cpu suspend data block.


pgpfTPUJOrwzT.pgp

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

2014-08-30 Thread Neel Natu
Author: neel
Date: Sat Aug 30 19:59:42 2014
New Revision: 270857
URL: http://svnweb.freebsd.org/changeset/base/270857

Log:
  The SUB instruction used in getcc() actually does 'x -= y' so use the
  proper constraint for 'x'. The +r constraint indicates that 'x' is an
  input and output register operand.
  
  While here generate code for different variants of getcc() using a macro
  GETCC(sz) where 'sz' indicates the operand size.
  
  Update the status bits in %rflags when emulating AND and OR opcodes.
  
  Reviewed by:  grehan

Modified:
  head/sys/amd64/vmm/vmm_instruction_emul.c

Modified: head/sys/amd64/vmm/vmm_instruction_emul.c
==
--- head/sys/amd64/vmm/vmm_instruction_emul.c   Sat Aug 30 19:55:54 2014
(r270856)
+++ head/sys/amd64/vmm/vmm_instruction_emul.c   Sat Aug 30 19:59:42 2014
(r270857)
@@ -316,46 +316,36 @@ vie_update_register(void *vm, int vcpuid
return (error);
 }
 
+#defineRFLAGS_STATUS_BITS(PSL_C | PSL_PF | PSL_AF | PSL_Z | PSL_N 
| PSL_V)
+
 /*
  * Return the status flags that would result from doing (x - y).
  */
-static u_long
-getcc16(uint16_t x, uint16_t y)
-{
-   u_long rflags;
-
-   __asm __volatile(sub %1,%2; pushfq; popq %0 :
-   =r (rflags) : m (y), r (x));
-   return (rflags);
-}
-
-static u_long
-getcc32(uint32_t x, uint32_t y)
-{
-   u_long rflags;
-
-   __asm __volatile(sub %1,%2; pushfq; popq %0 :
-   =r (rflags) : m (y), r (x));
-   return (rflags);
-}
-
-static u_long
-getcc64(uint64_t x, uint64_t y)
-{
-   u_long rflags;
-
-   __asm __volatile(sub %1,%2; pushfq; popq %0 :
-   =r (rflags) : m (y), r (x));
-   return (rflags);
-}
+#defineGETCC(sz)   
\
+static u_long  \
+getcc##sz(uint##sz##_t x, uint##sz##_t y)  \
+{  \
+   u_long rflags;  \
+   \
+   __asm __volatile(sub %2,%1; pushfq; popq %0 : \
+   =r (rflags), +r (x) : m (y)); \
+   return (rflags);\
+} struct __hack
+
+GETCC(8);
+GETCC(16);
+GETCC(32);
+GETCC(64);
 
 static u_long
 getcc(int opsize, uint64_t x, uint64_t y)
 {
-   KASSERT(opsize == 2 || opsize == 4 || opsize == 8,
+   KASSERT(opsize == 1 || opsize == 2 || opsize == 4 || opsize == 8,
(getcc: invalid operand size %d, opsize));
 
-   if (opsize == 2)
+   if (opsize == 1)
+   return (getcc8(x, y));
+   else if (opsize == 2)
return (getcc16(x, y));
else if (opsize == 4)
return (getcc32(x, y));
@@ -569,7 +559,7 @@ emulate_and(void *vm, int vcpuid, uint64
 {
int error, size;
enum vm_reg_name reg;
-   uint64_t val1, val2;
+   uint64_t result, rflags, rflags2, val1, val2;
 
size = vie-opsize;
error = EINVAL;
@@ -597,8 +587,8 @@ emulate_and(void *vm, int vcpuid, uint64
break;
 
/* perform the operation and write the result */
-   val1 = val2;
-   error = vie_update_register(vm, vcpuid, reg, val1, size);
+   result = val1  val2;
+   error = vie_update_register(vm, vcpuid, reg, result, size);
break;
case 0x81:
/*
@@ -625,11 +615,11 @@ emulate_and(void *vm, int vcpuid, uint64
switch (vie-reg  7) {
case 0x4:
/* modrm:reg == b100, AND */
-   val1 = vie-immediate;
+   result = val1  vie-immediate;
break;
case 0x1:
/* modrm:reg == b001, OR */
-   val1 |= vie-immediate;
+   result = val1 | vie-immediate;
break;
default:
error = EINVAL;
@@ -638,11 +628,29 @@ emulate_and(void *vm, int vcpuid, uint64
if (error)
break;
 
-   error = memwrite(vm, vcpuid, gpa, val1, size, arg);
+   error = memwrite(vm, vcpuid, gpa, result, size, arg);
break;
default:
break;
}
+   if (error)
+   return (error);
+
+   error = vie_read_register(vm, vcpuid, VM_REG_GUEST_RFLAGS, rflags);
+   if (error)
+   return (error);
+
+   /*
+* OF and CF are cleared; the SF, ZF and PF flags are set according
+* to the result; AF is undefined.
+*
+* The updated status flags are obtained by subtracting 0 from 'result'.
+ 

svn commit: r270858 - head/sys/arm/conf

2014-08-30 Thread Michael Tuexen
Author: tuexen
Date: Sat Aug 30 20:00:18 2014
New Revision: 270858
URL: http://svnweb.freebsd.org/changeset/base/270858

Log:
  Remove FDT option, since it is in every file, which includes this one.

Modified:
  head/sys/arm/conf/IMX6

Modified: head/sys/arm/conf/IMX6
==
--- head/sys/arm/conf/IMX6  Sat Aug 30 19:59:42 2014(r270857)
+++ head/sys/arm/conf/IMX6  Sat Aug 30 20:00:18 2014(r270858)
@@ -147,7 +147,6 @@ device  u3g # USB modems
 optionsROOTDEVNAME=\ufs:mmcsd0s2a\
 
 # ARM and SoC-specific options
-optionsFDT # Configure using FDT/DTB data.
 optionsSMP # Enable multiple cores
 optionsVFP # Enable floating point hardware support
 optionsFREEBSD_BOOT_LOADER # Process metadata passed from loader(8)
___
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: r270859 - head/sys/arm/conf

2014-08-30 Thread Michael Tuexen
Author: tuexen
Date: Sat Aug 30 20:18:47 2014
New Revision: 270859
URL: http://svnweb.freebsd.org/changeset/base/270859

Log:
  Enable SCTP support. It runs perfectly fine on a Wandboard quad.
  
  MFC after: 3 days

Modified:
  head/sys/arm/conf/IMX6

Modified: head/sys/arm/conf/IMX6
==
--- head/sys/arm/conf/IMX6  Sat Aug 30 20:00:18 2014(r270858)
+++ head/sys/arm/conf/IMX6  Sat Aug 30 20:18:47 2014(r270859)
@@ -25,7 +25,7 @@ options   SCHED_ULE   # ULE scheduler
 optionsPREEMPTION  # Enable kernel thread preemption
 optionsINET# InterNETworking
 optionsINET6   # IPv6 communications protocols
-#options   SCTP# Stream Control Transmission Protocol
+optionsSCTP# Stream Control Transmission Protocol
 optionsFFS # Berkeley Fast Filesystem
 optionsSOFTUPDATES # Enable FFS soft updates support
 optionsUFS_ACL # Support for access control lists
___
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: r270861 - in head/sys/cddl: compat/opensolaris/kern compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs

2014-08-30 Thread Steven Hartland
Author: smh
Date: Sat Aug 30 21:44:32 2014
New Revision: 270861
URL: http://svnweb.freebsd.org/changeset/base/270861

Log:
  Ensure that ZFS ARC free memory checks include cached pages
  
  Also restore kmem_used() check for i386 as it has KVA limits that the raw
  page counts above don't consider
  
  PR:   187594
  Reviewed by:  peter
  X-MFC-With: r270759
  Review:   D700
  Sponsored by: Multiplay

Modified:
  head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c
  head/sys/cddl/compat/opensolaris/sys/kmem.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c

Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c
==
--- head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.cSat Aug 30 
20:26:30 2014(r270860)
+++ head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.cSat Aug 30 
21:44:32 2014(r270861)
@@ -152,7 +152,7 @@ u_int
 kmem_free_count(void)
 {
 
-   return (vm_cnt.v_free_count);
+   return (vm_cnt.v_free_count + vm_cnt.v_cache_count);
 }
 
 u_int
@@ -169,6 +169,13 @@ kmem_size(void)
return (kmem_size_val);
 }
 
+uint64_t
+kmem_used(void)
+{
+
+   return (vmem_size(kmem_arena, VMEM_ALLOC));
+}
+
 static int
 kmem_std_constructor(void *mem, int size __unused, void *private, int flags)
 {

Modified: head/sys/cddl/compat/opensolaris/sys/kmem.h
==
--- head/sys/cddl/compat/opensolaris/sys/kmem.h Sat Aug 30 20:26:30 2014
(r270860)
+++ head/sys/cddl/compat/opensolaris/sys/kmem.h Sat Aug 30 21:44:32 2014
(r270861)
@@ -66,6 +66,7 @@ typedef struct kmem_cache {
 void *zfs_kmem_alloc(size_t size, int kmflags);
 void zfs_kmem_free(void *buf, size_t size);
 uint64_t kmem_size(void);
+uint64_t kmem_used(void);
 u_int kmem_page_count(void);
 
 /*

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   Sat Aug 30 
20:26:30 2014(r270860)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   Sat Aug 30 
21:44:32 2014(r270861)
@@ -2563,6 +2563,14 @@ arc_reclaim_needed(void)
 #endif /* sun */
 
 #else
+#ifdef __i386__
+   /* i386 has KVA limits that the raw page counts above don't consider */
+   if (kmem_used()  (kmem_size() * 3) / 4) {
+   DTRACE_PROBE2(arc__reclaim_used, uint64_t,
+   kmem_used(), uint64_t, (kmem_size() * 3) / 4);
+   return (1);
+   }
+#endif
if (spa_get_random(100) == 0)
return (1);
 #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: r270862 - head/sys/arm/arm

2014-08-30 Thread Ian Lepore
Author: ian
Date: Sat Aug 30 22:21:57 2014
New Revision: 270862
URL: http://svnweb.freebsd.org/changeset/base/270862

Log:
  Fix the handling of MMU type in the AP entry code.  The ARM_MMU_V6/V7
  symbols are always #defined to 0 or 1, so use #if SYM not #if defined(SYM).
  Also, it helps if you include the header file that defines the symbols.

Modified:
  head/sys/arm/arm/locore.S

Modified: head/sys/arm/arm/locore.S
==
--- head/sys/arm/arm/locore.S   Sat Aug 30 21:44:32 2014(r270861)
+++ head/sys/arm/arm/locore.S   Sat Aug 30 22:21:57 2014(r270862)
@@ -37,6 +37,7 @@
 #include sys/syscall.h
 #include machine/asm.h
 #include machine/armreg.h
+#include machine/cpuconf.h
 #include machine/pte.h
 
 __FBSDID($FreeBSD$);
@@ -389,9 +390,9 @@ ASENTRY_NP(mpentry)
nop
CPWAIT(r0)
 
-#if defined(ARM_MMU_V6)
+#if ARM_MMU_V6
bl  armv6_idcache_inv_all   /* Modifies r0 only */
-#elif defined(ARM_MMU_V7)
+#elif ARM_MMU_V7
bl  armv7_idcache_inv_all   /* Modifies r0-r3, ip */
 #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: r270863 - head/sys/tools/fdt

2014-08-30 Thread Ian Lepore
Author: ian
Date: Sat Aug 30 22:39:15 2014
New Revision: 270863
URL: http://svnweb.freebsd.org/changeset/base/270863

Log:
  Allow the make_dtb script to work outside of a make buildkernel context
  by setting MACHINE from uname -m if it's not set already.
  
  Reviewed by:  imp, tuexen

Modified:
  head/sys/tools/fdt/make_dtb.sh

Modified: head/sys/tools/fdt/make_dtb.sh
==
--- head/sys/tools/fdt/make_dtb.sh  Sat Aug 30 22:21:57 2014
(r270862)
+++ head/sys/tools/fdt/make_dtb.sh  Sat Aug 30 22:39:15 2014
(r270863)
@@ -12,6 +12,10 @@ if [ -z $dts ]; then
 exit 1
 fi
 
+if [ -z ${MACHINE} ]; then
+MACHINE=$(uname -m)
+fi
+
 for d in ${dts}; do
 dtb=${dtb_path}/`basename $d .dts`.dtb
 echo converting $d - $dtb
___
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