Commit Graph

76 Commits

Author SHA1 Message Date
thorpej a180cee23b Pool deals fairly well with physical memory shortage, but it doesn't
deal with shortages of the VM maps where the backing pages are mapped
(usually kmem_map).  Try to deal with this:

* Group all information about the backend allocator for a pool in a
  separate structure.  The pool references this structure, rather than
  the individual fields.
* Change the pool_init() API accordingly, and adjust all callers.
* Link all pools using the same backend allocator on a list.
* The backend allocator is responsible for waiting for physical memory
  to become available, but will still fail if it cannot callocate KVA
  space for the pages.  If this happens, carefully drain all pools using
  the same backend allocator, so that some KVA space can be freed.
* Change pool_reclaim() to indicate if it actually succeeded in freeing
  some pages, and use that information to make draining easier and more
  efficient.
* Get rid of PR_URGENT.  There was only one use of it, and it could be
  dealt with by the caller.

From art@openbsd.org.
2002-03-08 20:48:27 +00:00
tsutsui cf839323de Call malloc(9) with M_ZERO flag instead of memset() after malloc(). 2002-01-13 19:28:06 +00:00
lukem 2bbe2de647 add RCSIDs 2001-11-13 05:32:49 +00:00
jdolecek 539f3bcc23 change ccio_ndisks and sc_nccdisks of struct ccd_ioctl from int to u_int
introduce hard limit on number of disks which can be contcatenated togetger,
CCD_MAXNDISKS
2001-08-05 11:20:13 +00:00
thorpej c8b4ac1b17 bcopy -> memcpy
bzero -> memset
2001-07-07 17:04:01 +00:00
fvdl d040bd5908 Return error in the case of using ODIOCGDINFO or ODIOCGDEFLABEL when
the number of partitions is > OLDMAXPARTITIONS. This is better
than silently truncating the label (don't want to silently throw
away partitions when using an old disklabel binary on a label with
> 8 partitions). From Enami Tsugutomo.
2001-01-08 02:03:45 +00:00
fvdl e2d1c1f926 Adapt all disk devices in MI directories to handle ODIOC* calls
for ports that have bumped MAXPARTITIONS (and thus define
__HAVE_OLD_DISKLABEL).
2001-01-07 18:09:01 +00:00
enami 07702f68a6 Introduce new filesystem type FS_CCD so that an operator can mark the
ccd component partition.  Note that the ccd driver still allows partitions
of any types as components since an on-disk BSD disklabel isn't available
on some port.
2000-04-05 04:03:20 +00:00
augustss 169ac5b3c1 Remove register declarations. 2000-03-30 12:41:09 +00:00
enami aa8b5ebd93 On initialization failure, free all the storage allocated to store
component pathnames rather than the last one.
2000-03-16 03:54:01 +00:00
enami 34d63b5623 Since we now only allocate this one, no longer necessary to check and free(). 2000-02-08 12:56:00 +00:00
fvdl 0b1963121a Add Kirk McKusick's soft updates code to the trunk. Not enabled by
default, as the copyright on the main file (ffs_softdep.c) is such
that is has been put into gnusrc. options SOFTDEP will pull this
in. This code also contains the trickle syncer.

Bump version number to 1.4O
1999-11-15 18:49:07 +00:00
chs f13d3f5b3b from jason:
avoid biodone()ing the original buf twice when a component buf
gets an error.  fixes PR 8704.
1999-11-03 16:04:03 +00:00
thorpej dd5ae858e0 We really only need *one* componenet buffer pool... 1999-08-11 02:41:02 +00:00
mjacob fefcc128bf a kindler gentler fix 1999-03-04 02:38:19 +00:00
mjacob 7790083b17 adjust format args for compiler changes 1999-03-04 02:20:13 +00:00
thorpej 94962b67c7 Fix some printf format problems on Alpha. 1999-02-12 00:46:11 +00:00
thorpej c6aa25bfa1 Fix a st00p1d bug I introduced in rev 1.57, which would cause any activity
on non-0 CCD units to crash the system.
1999-01-21 00:35:15 +00:00
christos b62b5bc092 Make this compile again with -DDEBUG 1999-01-12 12:49:53 +00:00
thorpej 0272b2ab8e Whole lotta cleanup wrt. how configuration data is stored internally, and
just lockmgr(), not our home-grown locking functions.
1999-01-12 00:21:47 +00:00
thorpej d272bb0024 Handle the case where ccdbuffer() fails due to memory shortage. Build
a fifo of component buffers, and free them if ccdbuffer() fails.  Once
all component buffers are build, run through the fifo and fire off the
requests to the components.
1998-11-13 01:00:15 +00:00
thorpej 092c201932 Simplify calling of ccdbuffer() now that the mirroring code is nuked. 1998-11-13 00:35:57 +00:00
thorpej ab27c3f89c Return EINVAL if invalid flags are passed. 1998-11-13 00:31:02 +00:00
thorpej 00172c10d5 Nuke the mirroring code. RAIDframe is about to go in, and is a much
better mirroring solution.

The ccd driver will stay, even in the presence of RAIDframe, for applications
where just RAID-0 is needed (much smaller code footprint).
1998-11-13 00:26:19 +00:00
thorpej b6ac7c9b6b Must use PR_NOWAIT when allocating component buffers. 1998-11-12 22:39:57 +00:00
thorpej 4356136193 Use the pool allocator for component buffer headers. 1998-07-31 01:23:56 +00:00
thorpej 902855d60e Fix int32_t overflow with large serially concatenated components,
from Noriyuki SODA <soda@sra.co.jp>, PR #5729.
1998-07-09 20:56:12 +00:00
ross 331fee623e Sweep up some miscellaneous leftover lite2 integration shrapnel. 1998-03-01 07:15:39 +00:00
enami 9b770726e8 Fix message printed in case (b) in last commit; what actually shouldn't
exceeds is not a size of partition but end of partition.
1998-02-22 07:14:30 +00:00
enami 512a01869c Check disklabel just read from disk and warn if:
(a) total sector size is different from the size of ccd, or
	(b) size of a partition exceeds the size of ccd.
1998-02-22 06:50:08 +00:00
thorpej fd01cb624f Allow a ccd component to be on any partition type. 1998-02-06 08:13:07 +00:00
jtc d6ae2cd7fd Fix tipo inherited from old version of TNF copyright template. 1997-10-09 08:03:42 +00:00
thorpej 939e074dcc Implement DIOCGDEFLABEL. 1997-10-08 23:05:22 +00:00
fair c27c286843 %x -> 0x%x 1997-08-04 10:00:11 +00:00
kleink d72a3b2da1 Leftover from last commit: require us to be initialized when a DIOCGDINFO
ioctl(2) is issued; the uninitialized disklabel pointer might get dereferenced
otherwise.
1997-06-26 16:28:34 +00:00
thorpej 4cea35eb42 In ccdioctl(), consolidate checks for "open for writes" and "initialized". 1997-06-26 04:25:50 +00:00
thorpej e06bb29b00 Two changes to ccdsize():
- If the partition was previously open, don't do the open/close steps.
  (Sync with other disk drivers.)
- foosize()'s return value is in DEV_BSIZE units; adjust the size obtained
  from the disklabel accordingly.
1997-06-23 23:59:53 +00:00
mycroft 8f8b0d91e5 Remove bogus use of splhigh(), and apparently unneeded bzero(). 1997-03-12 22:31:37 +00:00
thorpej 9a815ed696 A performance optimization, inspired by a conversation with Thor Simon:
- Keep a freelist of component buffer headers, defaulting
	  to 8 headers per component (tunable with the CCDNBUF
	  kernel compile option).
	- When allocating a component buffer, try to pull a header
	  off the freelist first, falling back on MALLOC() if the
	  freelist is empty.  Use MALLOC() rather than malloc(),
	  because it will attempt to short-cut the allocation before
	  actually making a full-blown malloc() call.
	- Keep statistics on how many component buffer headers have
	  been allocated and how many of those allocations have
	  resulted in freelist misses.

With these changes, I observed measurable decreases in system and
wall clock time on operations on an 8G ccd, as well as a measurable
drop in the time spent in ccdbuffer() (measured with kernel profiling).
1997-01-30 04:00:52 +00:00
thorpej bb60822446 Fix OBOB in ccdopen() partition range check.
From Klaus Klein <kleink@layla.inka.de>, PR #3161.
1997-01-30 03:32:56 +00:00
thorpej 7770d7c428 Compute the componet number properly so that error reporting is somewhat
meaningful.  Bug noticed by Marshall Midden <m4@nts.umn.edu>.
1996-12-18 19:22:46 +00:00
christos 86373f8cf9 backout kprintf changes 1996-10-13 01:37:04 +00:00
christos 5d85fa8122 printf -> kprintf, sprintf -> ksprintf 1996-10-10 22:25:05 +00:00
thorpej 49c5d29ee0 Fix bogus return value in ccdopen(); it failed to indicate an error
condition if:
	- ccd was not initialized
	- partition did not exist
1996-05-05 04:21:14 +00:00
christos cee6ac0ce3 remove sys/cpu.h 1996-04-22 01:26:39 +00:00
christos e1930da21b Remove dependencies to dev_conf.h and the file itself. 1996-03-30 23:05:46 +00:00
mrg 2c329c900b %d -> %ld in a few places... 1996-03-24 01:26:57 +00:00
christos d318abdbc4 prototypes for ccd audio and ncr5380 1996-03-07 15:00:07 +00:00
thorpej ee8a2c002f Copyright assigned to The NetBSD Foundation. 1996-02-28 01:01:17 +00:00
thorpej 91bd533c48 Avoid deref'ing a bad pointer in ccdopen(). This could happen if
any partition other than RAW_PART is opened before configuring the
ccd.  Bug pointed out by Matthew Green.
1996-02-11 18:04:01 +00:00