avg [Fri, 11 Mar 2011 19:27:31 +0000 (19:27 +0000)]
use even larger stack size for ZFS txg_sync_thread
While the stack size was larger than the default stack size on i386, it
was smaller than the default stack size on amd64 and apparently that
wasn't enough. So, bump the size to 4 pages. Upcoming ZFSv28 code uses
8 pages for this stack size.
jhb [Fri, 11 Mar 2011 16:21:45 +0000 (16:21 +0000)]
MFC 219136:
Use a suitable DIRPRFX for each invocation of make in the build32 and
install32 targets so that the full path to each program or library is
displayed in the make output.
jhb [Fri, 11 Mar 2011 16:14:06 +0000 (16:14 +0000)]
MFC 219135:
Similar to 189574, properly handle subclasses of bus drivers when deleting
a driver during kldunload. Specifically, recursively walk the tree of
subclasses of a given driver attachment's bus device class detaching all
instances of that driver for each class and its subclasses.
delphij [Thu, 10 Mar 2011 01:02:53 +0000 (01:02 +0000)]
MFC r218432:
Don't consider ioctl returning error as a fatal error and move on to next
disk. When multiple devices are specified, a non-supporting ioctl will
cause diskinfo(8) to stop at the point which does not seem to be necessary.
Add "maxfilesize" mount option for tmpfs to allow specifying the
maximum file size limit. Default is UINT64_MAX when the option is
not specified. It was useless to set the limit to the total amount of
memory and swap in the system.
Use tmpfs_mem_info() rather than get_swpgtotal() in tmpfs_mount() to
check if there is enough memory available.
pluknet [Wed, 9 Mar 2011 12:14:49 +0000 (12:14 +0000)]
MFC r202897,r208164,r212174: msgbufp mapping changes on amd64.
r202897 by alc:
Simplify the mapping of the system message buffer. Use the direct map just
like ia64 does.
r208164 by alc:
Correct an error of omission in r202897: Now that amd64 uses the direct map
to access the message buffer, we must explicitly request that the underlying
physical pages are included in a crash dump.
r212174 by avg:
vm_page.c: include opt_msgbuf.h for MSGBUF_SIZE use in vm_page_startup
edwin [Tue, 8 Mar 2011 21:14:02 +0000 (21:14 +0000)]
MFC of tzdata2011c, r219411
- No leapsecond in June 2011
- Add and update timezones for America/Juneau, America/Sitka,
America/Metlakatla
- Change of Summer time to Winter time in Chili happens in April
2011, not in March 2011.
- Change the type of size_max to u_quad_t because its value is converted
with vfs_scanopt(9) using the "%qu" format string.
- Limit the maximum value of size_max to (SIZE_MAX - PAGE_SIZE) to
prevent overflow in howmany() macro.
PR: kern/141194
MFC r202187:
- Fix some style bugs in tmpfs_mount().
- Remove a stale comment about tmpfs_mem_info() 'total' argument.
MFC r202708:
- Change the type of nodes_max to u_int and use "%u" format string to
convert its value.
- Set default tm_nodes_max to min(pages + 3, UINT32_MAX). It's more
reasonable than the old four nodes per page (with page size 4096) because
non-empty regular files always use at least one page. This fixes possible
overflow in the calculation.
- Don't allow more than tm_nodes_max nodes allocated in tmpfs_alloc_node().
jkim [Mon, 7 Mar 2011 18:00:58 +0000 (18:00 +0000)]
MFC: r218293
Do not let pw.conf(5) or -M option affect creation of basehome, e.g., /home.
When the basehome does not exist, it creates all intermediate directories as
required, which is logically equivalent to mkdir(1) with -m and -p options.
However, it modifies all intermediate directories, not just the final home
directory unlike mkdir. This problem was introduced in two revisions, i.e.,
r1.59 (SVN r167919) and r1.60 (SVN r168044).
jhb [Mon, 7 Mar 2011 17:15:10 +0000 (17:15 +0000)]
MFC 218970,219240:
Use umtx_key objects to uniquely identify futexes. Private futexes in
different processes that happen to use the same user address in the
separate processes will now be treated as distinct futexes rather than the
same futex. We can now honor shared futexes properly by mapping them to a
AUTO_SHARED umtx_key. Private futexes use THREAD_SHARED umtx_key objects.
Use g_eventlock to protect against losing wakeups in the g_event process
and replace tsleep(9) with msleep(9) which doesn't use a timeout. The
previously used timeout caused the event process to wake up ten times
per second on an idle system.
one_event() is now called with the topology lock held and it returns
with both the topology and event locks held when there are no more
events in the queue.
yongari [Mon, 7 Mar 2011 00:42:22 +0000 (00:42 +0000)]
MFC r219102:
Make sure changing ownership of RX descriptor to be done as last
operation. Previously ownership was transferred to hardware before
setting address of new RX buffer such that it was possible for
hardware to use wrong RX buffer address.
While here keep compiler from re-ordering instructions by declaring
descriptor members volatile. Memory barriers would do the same job
but volatile is supposed to be cheaper than using memory barriers,
especially on MP systems.
marius [Sun, 6 Mar 2011 11:51:39 +0000 (11:51 +0000)]
MFC: r216013, r216083
Several chipset drivers alter parameters relevant for the DMA tag creation,
i.e. alignment, max_address, max_iosize and segsize (only max_address is
thought to have an negative impact regarding this issue though), after
calling ata_dmainit() either directly or indirectly so these values have
no effect or at least no effect on the DMA tags and the defaults are used
for the latter instead. So change the drivers to set these parameters
up-front and ata_dmainit() to honor them.
marius [Sun, 6 Mar 2011 11:43:02 +0000 (11:43 +0000)]
- Use the correct DMA tag/map pair for synchronize the FC scratch area.
- Allocate coherent DMA memory for the request/response queue area and
and the FC scratch area.
These changes allow isp(4) to work properly on sparc64 with usage of the
IOMMU streaming buffers enabled.
Add opteron-sse3, athlon64-sse3 and k8-sse3 cpu types to bsd.cpu.mk.
- add "sse3" to MACHINE_CPU for the new cpu types
- for i386, default to CPUTYPE=prescott for the new cpu types
Add opteron-sse3, athlon64-sse3 and k8-sse3 cpu types to bsd.cpu.mk.
- add "sse3" to MACHINE_CPU for the new cpu types
- for i386, default to CPUTYPE=prescott for the new cpu types
Backport svn r124339 from gcc 4.3 and add opteron-sse3, athlon64-sse3
and k8-sse3 cpu-types for -march=/-mtune= gcc options.
These new cpu-types include the SSE3 instruction set that is supported
by all newer AMD Athlon 64 and Opteron processors.
All three cpu-types are supported by clang and all gcc versions
starting with 4.3 SVN rev 124339 (at that time GPLv2 licensed).
das [Sun, 6 Mar 2011 08:50:15 +0000 (08:50 +0000)]
Bump __FreeBSD_version for the MFC of log2(), for the benefit of ports
such as opencity and inkscape that have workarounds for the lack of a
log2() in the base system.
MFC r212067 (pjd):
Eliminate confusing while () loop. In the first version of the code it was
there to avoid gotos, but in the current version it serves no purpose.
MFC r214623 (pjd):
Fix ztest when it is executed by just 'ztest' and not by full path
'/usr/bin/ztest'.
jhb [Thu, 3 Mar 2011 20:13:44 +0000 (20:13 +0000)]
MFC 218968:
Properly handle BARs bigger than 4G. The '1' was treated as an int
causing the size calculation to be truncated to the size of an int
(32-bits on all current architectures).
jhb [Thu, 3 Mar 2011 19:57:38 +0000 (19:57 +0000)]
MFC 218777:
Save a copy of errno before invoking syslog() if accept() or select() fail.
syslog() can trash the errno value causing nfsd to exit for non-fatal
errors like ECONNABORTED from accept().
jhb [Thu, 3 Mar 2011 18:52:11 +0000 (18:52 +0000)]
MFC 216487,217754,218524:
- Pass JFLAG as JFLAG from tinderbox to universe.
- For `make tinderbox` there is no need to print the extra commands.
- Add a new UNIVERSE_TARGET variable for 'make universe'. If it is set,
then that target is invoked for each architecture rather than the
default action of building world and kernels for each architecture.
- Add a 'make toolchains' wrapper which uses UNIVERSE_TARGET to build
toolchains for all architectures.
- Document JFLAG, MAKE_JUST_KERNELS, and MAKE_JUST_WORLDS variables for
'make universe'.
If dlclose() is called recursively from a _fini() function, the inner
dlclose() call may unload the object of the outer call prematurely
because objects are unreferenced before _fini() calls.
Fix this by unreferencing objects after calling objlist_call_fini() in
dlclose(). Therefore objlist_call_fini() now calls the fini function if
the reference count of an object is 1. In addition we must restart the
list_fini traversal after every _fini() call because another dlclose()
call might have modified the reference counts.
Add an XXX comment to objlist_call_fini() about possible race with
dlopen().
jhb [Thu, 3 Mar 2011 16:58:58 +0000 (16:58 +0000)]
MFC 218270:
Use M_WAITOK rather than M_NOWAIT when creating taskqueues via the
TASKQUEUE_DEFINE macros. All the places that use these macros to create
taskqueues assume that the operation succeeds.
jkim [Thu, 3 Mar 2011 00:24:55 +0000 (00:24 +0000)]
MFC: r217515, r217519, r217539
Add reader/writer lock around mem_range_attr_get() and mem_range_attr_set().
Compile sys/dev/mem/memutil.c for all supported platforms and remove now
unnecessary dev_mem_md_init(). Consistently define mem_range_softc from
mem.c for all platforms. Add missing #include guards for machine/memdev.h
and sys/memrange.h. Clean up some nearby style(9) nits.
jhb [Wed, 2 Mar 2011 21:50:59 +0000 (21:50 +0000)]
MFC 217239:
Add a nested include of <sys/linker_set.h> to make the sysctl(9) manpage
accurate. <sys/linker_set.h> is one of the very few headers similar to
<sys/queue.h> for which nested includes is allowed.
dchagin [Wed, 2 Mar 2011 20:08:52 +0000 (20:08 +0000)]
MFC r218879:
Do not clobber %rdx.
Before calling vfork() syscall the linux user-space stores the current PID
in the %rdx and restore it when the parent process leaves the kernel.
dchagin [Wed, 2 Mar 2011 20:04:54 +0000 (20:04 +0000)]
MFC r218744:
To avoid excessive code duplication create wrapper for fill regs
from stack frame. Change the trap() code to use newly created function
instead of explicit regs assignment.
dchagin [Wed, 2 Mar 2011 20:01:24 +0000 (20:01 +0000)]
MFC r218719 (by hand, depends on r209592):
Make a linux_rt_sigtimedwait() system call is actually working.
1) Translate the native signal number in the appropriate Linux signal.
2) Remove bogus code, which can lead to a panic as it calls
kern_sigtimedwait with the same ksiginfo.
3) Return the corresponding signal number.
jhb [Wed, 2 Mar 2011 19:27:01 +0000 (19:27 +0000)]
MFC 217805:
Fix a LOR by dropping the global ifnet locks while allocating a new ifnet
table in if_grow(). The order of the SYSINIT's for ifnet state were swapped
so that the various locks were initialized before being used.
jkim [Wed, 2 Mar 2011 19:09:49 +0000 (19:09 +0000)]
MFC: r216634, r216673
Improve PCB flags handling and make it more robust. Add two new functions
for manipulating pcb_flags. These inline functions are very similar to
atomic_set_int(9) and atomic_clear_int(9) but without unnecessary LOCK
prefix for SMP. Add comments about the rationale. Use these functions
wherever possible. Although there are some places where it is not strictly
necessary (e.g., a PCB is copied to create a new PCB), it is done across
the board for sake of consistency. Turn pcb_full_iret into a PCB flag as
it is safe now. Move rarely used fields before pcb_flags and reduce size
of pcb_flags to four bytes. Fix some style(9) nits in pcb.h while I am in
the neighborhood.
netchild [Wed, 2 Mar 2011 09:53:13 +0000 (09:53 +0000)]
MFC r215664:
By using the 32-bit Linux version of Sun's Java Development Kit 1.6
on FreeBSD (amd64), invocations of "javac" (or "java") eventually
end with the output of "Killed" and exit code 137.
This is caused by:
1. After calling exec() in multithreaded linux program threads are not
destroyed and continue running. They get killed after program being
executed finishes.
2. linux_exit_group doesn't return correct exit code when called not
from group leader. Which happens regularly using sun jvm.
The submitters fix this in a similar way to how NetBSD handles this.
I took the PRs away from dchagin, who seems to be out of touch of
this since a while (no response from him).
The patches committed here are from [2], with some little modifications
from me to the style.
PR: 141439 [1], 144194 [2]
Submitted by: Stefan Schmidt <stefan.schmidt@stadtbuch.de>, gk
Reviewed by: rdivacky (in april 2010)
MFC r215675:
Do not take the process lock. The assignment to u_short inside the
properly aligned structure is atomic on all supported architectures, and
the thread that should see side-effect of assignment is the same thread
that does assignment.
Use a more appropriate conditional to detect the linux ABI.