Commit Graph

40594 Commits

Author SHA1 Message Date
Tim J. Robbins
a222314fe6 Merge from NetBSD src/sys/ntfs/ntfs_subr.c 1.5 & 1.30 (jdolecek):
- Avoid calling bread() with different sizes on the same blkno.
  Although the buffer cache is designed to handle differing size
  buffers, it erroneously tries to write the incorrectly-sized buffer
  buffer back to disk before reading the correctly-sized one, even
  when it's not dirty. This behaviour caused a panic for read-only
  NTFS mounts when INVARIANTS was enabled ("bundirty: buffer x still
  on queue y"), reported by NAKAJI Hiroyuki.
- Fix a bug in the code handling holes: a variable was incremented
  instead of decremented, which could cause an infinite loop.
2003-06-20 14:52:52 +00:00
Hidetoshi Shimokawa
e14720d614 Use direct map in pmap_map().
This saves much KVA for vm_pages and you don't need to increase NKPT
for large physical memory anymore.

Suggested by: dfr
2003-06-20 14:09:33 +00:00
Stefan Eßer
c2ef4dd48a Add comment about **vpp being special-cased in vnode_if.awk (1.38) 2003-06-20 12:24:06 +00:00
Stefan Eßer
86ed89620e The assertions generated to test VFS locking never included checks
for vnodes reached through double indirection (i.e. **vpp). This
is worked-around by special-casing the identifier "vpp" (adding one
level of indirection).

The alternative fix mentioned in the PR had required substantial
changes to this script.

In case there are locking violations that had been hidden without
this patch, they may suddenly show up, now ...

This change does not affect code compiled without DEBUG_VFS_LOCKS.

PR:		kern/46652
2003-06-20 12:15:37 +00:00
David Xu
ab78d4d641 cpu_set_upcall_kse needs to access userspace, release schedule lock
before calling it for bound thread. To avoid this problem, change
thread_schedule_upcall to not put new thread on run queue, let caller
do it, so we can tweak the new thread before setting it to run.

Reported by: pho
2003-06-20 09:12:12 +00:00
Poul-Henning Kamp
166400b7e6 Don't put callout_lock under #ifdef DIAGNOSTIC despite the fact that it
works anyway.
2003-06-20 08:39:04 +00:00
Poul-Henning Kamp
adece6e592 Initialize b_saveaddr when we hand out pbufs 2003-06-20 08:35:28 +00:00
Poul-Henning Kamp
568733688b Initialize b_saveaddr when we hand out buffers 2003-06-20 08:26:38 +00:00
Poul-Henning Kamp
ce6912c420 Crude but efficient:
#ifdef DIAGNOSTIC hold a mutex while calling callout's so that we hear
about it if they sleep.
2003-06-20 08:07:15 +00:00
Poul-Henning Kamp
eaaca5deee Don't (re)initialize f_gcflag to zero.
Move initialization of DTYPE_VNODE specific field f_seqcount into
the DTYPE_VNODE specific code.
2003-06-20 08:02:30 +00:00
Poul-Henning Kamp
c066b8920e Move FMARK and FDEFER til sys/file.h where they belong.
Order the fields in struct file in sections after their scope.
2003-06-20 07:59:59 +00:00
John-Mark Gurney
b9d3718a18 fix another LP64 problem. READ_IVAR takes a pointer to an uintptr_t, not
an int.
2003-06-20 07:22:54 +00:00
Alan Cox
e50346b5e0 The so-called "optimized copy-on-write fault" case should not require
the vm map lock.  What's really needed is vm object locking, which
is (for the moment) provided Giant.

Reviewed by:	tegge
2003-06-20 04:20:36 +00:00
David Xu
062cf543fc When a STOP signal is being sent to a process, it is possible all
threads in the process have already masked the signal, so job control
is delayed. But later a thread unmasking the STOP signal should enable
job control, so in issignal(), scanning all threads in process to see
if we can direct suspend some of them, not just suspend current thread.
2003-06-20 03:36:45 +00:00
David Xu
8b56079e2b Fix typo. td should be td0. 2003-06-20 01:56:28 +00:00
Jake Burkholder
d4c737a952 Avoid using v8 opcodes; use ba instead of b for unconditional branches. 2003-06-19 19:11:21 +00:00
Alfred Perlstein
bab88630ba Unlock the struct file lock before aquiring Giant, otherwise
we can deadlock because of lock order reversals.  This was not
caught because Witness ignores pool mutexes right now.

Diagnosis and help: truckman
Noticed by: pho
2003-06-19 18:13:07 +00:00
Jake Burkholder
d6c28affbd Hook openpromio up to the build. 2003-06-19 18:06:58 +00:00
Alan Cox
a38918cdbd Lock the vm object when freeing a vm page. 2003-06-19 17:56:12 +00:00
Søren Schmidt
d72d63c03e Add support for the HighPoint HPT302 & HPT371
HW sponsored by:	Martin Blapp <mbr@FreeBSD.ORG>
2003-06-19 15:11:04 +00:00
Hidetoshi Shimokawa
d25ac2fa68 Fix direct map page table for 2GB+ physical memory.
You may still need to increase NKPT for larger memory.
I have successfully booted 8GB system with NKPT=256.
2003-06-19 12:14:37 +00:00
Marcel Moolenaar
e2905ce3a0 Add TLS related relocation. 2003-06-19 06:51:43 +00:00
Mike Silbersack
b083ea5114 Add a ratelimited message of the form
"maxproc limit exceeded by uid %i, please see tuning(7) and login.conf(5)."

Which will be triggered whenever a user hits his/her maxproc limit or
the systemwide maxproc limit is reached.

MFC after:	1 week
2003-06-19 05:57:25 +00:00
Jake Burkholder
f96c24256c - Rename the IPI_WAIT macro to IPI_DONE.
- Don't require all receivers of ipis to wait for all other receivers,
  only that the sender wait for all receivers.  This should reduce the
  amount of time spent with interrupts disabled, which may be a cause
  of ipi timeouts.

Discussed with:	tmm
2003-06-19 05:27:04 +00:00
Don Lewis
6084b6c9d5 FILE_LOCK() uses a pool mutex, as does the vnode v_vnlock. Since pool
mutexes are supposed to only be used as leaf mutexes, and what appear
to be separate pool mutexes could be aliased together, it is bad idea
for a thread to attempt to hold two pool mutexes at the same time.

Slightly rearrange the code in kern_open() so that FILE_UNLOCK() is
called before calling VOP_GETVOBJECT(), which will grab the v_vnlock
mutex.
2003-06-19 04:10:56 +00:00
Mike Silbersack
4d7dfc31b8 Add a rate limited message reporting when kern.maxfiles is exceeded,
reporting who did it.

Also, fix a style bug introduced in the previous change.

MFC after:	1 week
2003-06-19 04:07:12 +00:00
Don Lewis
8d5f9131fc VOP_GETVOBJECT() wants to be called with the vnode lock held. 2003-06-19 03:55:01 +00:00
Alan Cox
82b8b18959 Lock the vm object when freeing a vm page. 2003-06-19 03:38:05 +00:00
Alan Cox
95aada383f Lock the vm object when freeing a vm page. 2003-06-19 03:08:10 +00:00
John-Mark Gurney
9c77e81b5d make iicbb_devclass and iicbb_driver globally visible. This will let
drivers that implemnt the i2c bit banging bus interface not have to
recompile iicbb in order to add an attachment for it.

This will mean the bktr and other definitions can go back to their
respective drivers.
2003-06-19 02:50:08 +00:00
Alan Cox
f873ed0327 Add vm object locking. 2003-06-19 02:01:33 +00:00
Alan Cox
37681d8642 Assert that the vm object is locked in vm_page_try_to_free(). 2003-06-19 01:50:14 +00:00
Scott Long
ed3392975b Fixing some glaring problems with aac_disk_dump().
- Mark that it cannot handle greater than 4GB of RAM at this time.  Fixing
   that will come later.  Fail any attempts to dump above thati limit.
 - If a call to aac_disk_dump() needs to be split into multiple i/o's,
   increment the virtual offset after each i/o instead of just dumping the
   same offset over and over again.
 - Bail out if bus_dmamap_load() returns an error.  Error recovery is likely
   not possible.
2003-06-19 01:49:04 +00:00
Alan Cox
d18e8afe99 Fix a vm object reference leak in the page-based copy-on-write mechanism
used by the zero-copy sockets implementation.

Reviewed by:	gallatin
2003-06-19 01:40:44 +00:00
Jake Burkholder
1de46e12a3 Add a solaris compatible ofw interface for third party software that
expects one to use.  Only the functions used by XFree86 are actually
implemented.

Glanced at by:	tmm
2003-06-19 01:40:11 +00:00
Poul-Henning Kamp
2db4b023bb Introduce a new flag on a file descriptor: DFLAG_SEEKABLE and use that
rather than assume that only DTYPE_VNODE is seekable.
2003-06-18 19:53:59 +00:00
Mike Silbersack
438f085b2f Reserve the last 5% of file descriptors for root use. This should allow
systems to fail more gracefully when a file descriptor exhaustion situation
occurs.

Original patch by:	David G. Andersen <dga@lcs.mit.edu>
PR:			45353
MFC after:		1 week
2003-06-18 18:57:58 +00:00
Poul-Henning Kamp
7c2d2efd58 Initialize struct fileops with C99 sparse initialization. 2003-06-18 18:16:40 +00:00
Jake Burkholder
d58a33063a Add FBTYPEs used by the sbus bus support in XFree86. This uses some of
the values that are "reserved", but they are not reserved anywhere else
so I'm assuming this is what they were unreserved for.  Unfortunately
some of the values for local syscons types overlap the values used for
sbus adapters elsewhere, so we can't have all the same values.
2003-06-18 17:49:52 +00:00
Jake Burkholder
26f66ceae3 Ignore fake ttes in pmap_copy, its too hard to deal with them not having
a real vm_page right now.  This fixes a panic when processes with resident
device mappings fork, such as the X server.
2003-06-18 17:03:04 +00:00
Thomas Moestl
6d3b2a3cad Further cleanup of the sparc64 busdma implementation:
- Move prototypes for sparc64-specific helper functions from bus.h to
  bus_private.h
- Move the method pointers from struct bus_dma_tag into a separate
  structure; this saves some memory, and allows to use a single method
  table for each busdma backend, so that the bus drivers need no longer
  be changed if the methods tables need to be modified.
- Remove the hierarchical tag method lookup. It was never really useful,
  since the layering is fixed, and the current implementations do not
  need to call into parent implementations anyway. Each tag inherits
  its method table pointer and cookie from the parent (or the root tag)
  now, and the method wrapper macros directly use the method table
  of the tag.
- Add a method table to the non-IOMMU backend, remove unnecessary
  prototypes, remove the extra parent tag argument.
- Rename sparc64_dmamem_alloc_map() and sparc64_dmamem_free_map() to
  sparc64_dma_alloc_map() and sparc64_dma_free_map(), move them to a
  better place and use them for all map allocations and deallocations.
- Add a method table to the iommu backend, and staticize functions,
  remove the extra parent tag argument.
- Change the psycho and sbus drivers to just set cookie and method table
  in the root tag.
- Miscellaneous small fixes.
2003-06-18 16:41:36 +00:00
Alexander Kabaev
cc2e7a0607 Add defines required for TLS support. 2003-06-18 16:38:22 +00:00
Jake Burkholder
28ab032ea9 Moved the syscons options, kbd options and DEV_SPLASH to the MI options
file.
2003-06-18 15:25:01 +00:00
Hartmut Brandt
92fe9ad65b Now that most of this file is new, stylify the rest and correct the
style bugs (space/tab) introduced by me.
2003-06-18 10:53:49 +00:00
Poul-Henning Kamp
44be139bbb Sleep on "-" in our normal state to simplify debugging. 2003-06-18 10:33:09 +00:00
Hartmut Brandt
1329537b7a Style: __FBSDID(). 2003-06-18 09:31:37 +00:00
Poul-Henning Kamp
22db1e9ff5 Add "GEOM_FOX", a class which detects and selects between multiple
redundant paths to the same device.

This class reacts to a label in the first sector of the device,
which is created the following way:

        #    "0123456789abcdef012345..."
        #    "<----magic-----><-id-...>
        echo "GEOM::FOX       someid" | dd of=/dev/da0 conv=sync

NB: Since the fact that multiple disk devices are in fact the same
    device is not known to GEOM, the geom taste/spoil process cannot
    fully catch all corner cases and this module can therefore be
    confused if you do the right wrong things.

NB: The disk level drivers need to do the right thing for this to
    be useful, and that is not by definition currently the case.
2003-06-18 09:29:28 +00:00
Poul-Henning Kamp
777ca648ab Add missing */ 2003-06-18 06:49:28 +00:00
Alan Cox
31953be936 Lock the vm object when freeing a vm page. 2003-06-18 04:27:18 +00:00
Matthew N. Dodd
da9f245470 - Add support for DT_FLAGS.
- Define various things from the most recent ELF spec.
2003-06-18 03:34:29 +00:00