The NetBSD Project

CVS log for src/sys/rump/librump/rumpkern/Attic/memalloc.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / rump / librump / rumpkern

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.22, Wed Jun 17 11:46:34 2015 UTC (8 years, 10 months ago) by pooka
Branch: MAIN
CVS Tags: thorpej-futex-base, prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646, localcount-20160914, isaki-audio2-base, isaki-audio2, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh, bouyer-sunxi-drm-base, bouyer-sunxi-drm, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan, ad-namecache-base3, ad-namecache-base2, ad-namecache-base1, ad-namecache-base, ad-namecache, HEAD
Changes since 1.21: +2 -2 lines
FILE REMOVED

Remove unreal allocators, unconditionally use subr_{kmem,pool}.

Will, with other work, allow to tighten the memory allocation hypercall
specification to page-granularity allocations in the future.

Revision 1.21 / (download) - annotate - [select for diffs], Sat Apr 27 15:34:53 2013 UTC (10 years, 11 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, rmind-smpnet-nbase, rmind-smpnet-base, rmind-smpnet, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, nick-nhusb-base-20150606, nick-nhusb-base-20150406, nick-nhusb-base, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, khorben-n900
Branch point for: nick-nhusb
Changes since 1.20: +5 -47 lines
Diff to previous 1.20 (colored)

* treat kern_malloc.c as an unreal allocator (it's so lightweight)
* get rid of the rumpuser_realloc() hypercall
* pass size to rumpuser_free()

Revision 1.20 / (download) - annotate - [select for diffs], Sun Mar 10 17:05:12 2013 UTC (11 years, 1 month ago) by pooka
Branch: MAIN
CVS Tags: agc-symver-base, agc-symver
Changes since 1.19: +11 -5 lines
Diff to previous 1.19 (colored)

Use kern_malloc.c instead of the relegated allocators in memalloc.c.
Previously this didn't make sense due to the use of kmem_map, but the
new malloc is more dynamic and puts sense into using it.

Revision 1.19 / (download) - annotate - [select for diffs], Sun Mar 10 16:27:11 2013 UTC (11 years, 1 month ago) by pooka
Branch: MAIN
Changes since 1.18: +3 -68 lines
Diff to previous 1.18 (colored)

Always include subr_vmem.c, even with RUMP_UNREAL_ALLOCATORS=yes
(previously it was just missing in that case).

Record wchan to unreal pool_init() to avoid memory leak warning.

Revision 1.18 / (download) - annotate - [select for diffs], Fri Jul 20 09:20:05 2012 UTC (11 years, 9 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6
Branch point for: tls-maxphys
Changes since 1.17: +4 -4 lines
Diff to previous 1.17 (colored)

Make it possible to select between real and unreal allocators from
make.  Plus some gratuitous renaming.

Revision 1.17 / (download) - annotate - [select for diffs], Fri Jul 20 09:11:33 2012 UTC (11 years, 9 months ago) by pooka
Branch: MAIN
Changes since 1.16: +12 -2 lines
Diff to previous 1.16 (colored)

make unreal allocators work again

Revision 1.16 / (download) - annotate - [select for diffs], Tue Jun 5 22:51:47 2012 UTC (11 years, 10 months ago) by jym
Branch: MAIN
Changes since 1.15: +3 -10 lines
Diff to previous 1.15 (colored)

Now that pool_cache_invalidate() is synchronous and can handle per-CPU
caches, merge together pool_drain_start() and pool_drain_end() into

bool pool_drain(struct pool **ppp);

"bool" value indicates whether reclaiming was fully done (true) or not (false)
"ppp" will contain a pointer to the pool that was drained (optional).

See http://mail-index.netbsd.org/tech-kern/2012/06/04/msg013287.html

Revision 1.15 / (download) - annotate - [select for diffs], Sun Apr 29 20:27:32 2012 UTC (11 years, 11 months ago) by dsl
Branch: MAIN
CVS Tags: yamt-pagecache-base5, jmcneill-usbmp-base10
Changes since 1.14: +2 -16 lines
Diff to previous 1.14 (colored)

Remove everything to do with 'struct malloc_type' and the malloc link_set.
To make code in 'external' (etc) still compile, MALLOC_DECLARE() still
  has to generate something of type 'struct malloc_type *', with
  normal optimisation gcc generates a compile-time 0.
MALLOC_DEFINE() and friends have no effect.
Fix one or two places where the code would no longer compile.

Revision 1.14 / (download) - annotate - [select for diffs], Sun Apr 29 16:36:53 2012 UTC (11 years, 11 months ago) by dsl
Branch: MAIN
CVS Tags: jmcneill-usbmp-base9
Changes since 1.13: +5 -19 lines
Diff to previous 1.13 (colored)

Remove the unused 'struct malloc_type' args to kern_malloc/realloc/free
The M_xxx arg is left on the calls to malloc() and free(),
  maybe they could be converted to an enumeration and just saved in
  the malloc header (for deep diag use).
Remove the malloc_type from mbuf extension.
Fixes rump build as well.
Welcome to 6.99.6

Revision 1.13 / (download) - annotate - [select for diffs], Sun Apr 29 14:00:15 2012 UTC (11 years, 11 months ago) by rmind
Branch: MAIN
Changes since 1.12: +16 -2 lines
Diff to previous 1.12 (colored)

Fix RUMP build.

Revision 1.12 / (download) - annotate - [select for diffs], Sat Feb 4 22:11:43 2012 UTC (12 years, 2 months ago) by para
Branch: MAIN
CVS Tags: yamt-pagecache-base4, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2
Changes since 1.11: +6 -6 lines
Diff to previous 1.11 (colored)

make acorn26 compile by fixing up subpage pool allocations

ok: riz@

Revision 1.11 / (download) - annotate - [select for diffs], Sun Jul 11 11:27:47 2010 UTC (13 years, 9 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2, rmind-uvmplock-nbase, rmind-uvmplock-base, matt-mips64-premerge-20101231, jruoho-x86intr-base, jruoho-x86intr, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base, jmcneill-audiomp3-base, jmcneill-audiomp3, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Branch point for: yamt-pagecache, jmcneill-usbmp
Changes since 1.10: +5 -4 lines
Diff to previous 1.10 (colored)

Reflect change to pool_drain_end.  Makes -DRUMP_USE_UNREAL_ALLOCATORS
compile (and work) again.

Revision 1.10 / (download) - annotate - [select for diffs], Thu Jul 8 11:39:58 2010 UTC (13 years, 9 months ago) by pooka
Branch: MAIN
Changes since 1.9: +6 -2 lines
Diff to previous 1.9 (colored)

Emulate malloc(9) a little better by panicking if a should-not-fail
allocation fails.  We could invoke the pagedaemon here, but since
malloc(9) is panicky when it runs out of kmem_map, let's do the
"same".

Revision 1.9 / (download) - annotate - [select for diffs], Mon Jun 14 21:04:56 2010 UTC (13 years, 10 months ago) by pooka
Branch: MAIN
Changes since 1.8: +3 -3 lines
Diff to previous 1.8 (colored)

Make it possible to define an upper limit for memory consumed by
the rump kernel by specifying RUMP_MEMLIMIT.  In case allocation
over that limit is attempted, essentially pool reclaim and uvm_wait()
is done.  The default is to allow to allocate as much as the host
will give.

XXX: uvm_km_alloc and malloc(9) do not currently conform.  the
former is easy, the latter requires kern_malloc.c (rump malloc is
currently directly relegated to host malloc).

Revision 1.8 / (download) - annotate - [select for diffs], Thu Jun 3 19:36:21 2010 UTC (13 years, 10 months ago) by pooka
Branch: MAIN
Changes since 1.7: +3 -3 lines
Diff to previous 1.7 (colored)

Don't use rumpuser_malloc() directly.

Revision 1.7 / (download) - annotate - [select for diffs], Thu Jun 3 10:56:20 2010 UTC (13 years, 10 months ago) by pooka
Branch: MAIN
Changes since 1.6: +20 -10 lines
Diff to previous 1.6 (colored)

Implement a sort-of pagedaemon: adjust all memory allocators to go
through an in-rumpkernel hypermemory allocator which knows it should
kick the pagedaemon and block in case ``waitok'' memory allocation
fails.

This allows us to recover from some out-of-memory situations.
Realworld'istically speaking (as opposed to whatever "should be"
theory), these OOM situations will happen extremely rarely if ever
when our hypervisor is a regular process.  Speculatively, this
should be useful for other types of hosts.

issues remaining:
 * the hypervisor does not know how to reclaim kernel memory (and
   for the reason I stated above, I'm not sure if it makes sense
   to teach the current implementation about that)
 * vfs memory (buffers, vm object pages etc.) is not reclaimed

Revision 1.6 / (download) - annotate - [select for diffs], Tue Jun 1 20:11:33 2010 UTC (13 years, 10 months ago) by pooka
Branch: MAIN
Changes since 1.5: +7 -6 lines
Diff to previous 1.5 (colored)

Don't pass "canfail" down to rumpuser_malloc -- there's quite little
we can do with that info way down there.  Instead, pass alignment.
Implement rumpuser_malloc() with posix_memalign().

Revision 1.5 / (download) - annotate - [select for diffs], Fri Jan 15 19:01:04 2010 UTC (14 years, 3 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9, uebayasi-xip-base1, uebayasi-xip-base
Branch point for: yamt-nfs-mp, uebayasi-xip, rmind-uvmplock
Changes since 1.4: +63 -2 lines
Diff to previous 1.4 (colored)

Use subr_percpu.c instead of homegrown implementation.  ...except
when using malloc(3)-relegated allocators (happens in production
e.g. on Linux), since subr_percpu.c uses vmem and i don't want to
reimplement vmem.

Revision 1.4 / (download) - annotate - [select for diffs], Mon Jan 11 19:19:57 2010 UTC (14 years, 3 months ago) by stacktic
Branch: MAIN
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (colored)

Fixed typo.

Revision 1.3 / (download) - annotate - [select for diffs], Wed Dec 23 17:16:40 2009 UTC (14 years, 3 months ago) by stacktic
Branch: MAIN
Changes since 1.2: +8 -1 lines
Diff to previous 1.2 (colored)

Fixed build when using unreal allocators.

Revision 1.2 / (download) - annotate - [select for diffs], Fri Nov 27 13:45:15 2009 UTC (14 years, 4 months ago) by pooka
Branch: MAIN
CVS Tags: matt-premerge-20091211
Changes since 1.1: +11 -3 lines
Diff to previous 1.1 (colored)

Now that Makefile.rump was changed and everything gets built in
update builds too, flip the allocator define to prefer the kernel
pool/kmem instead of malloc(3).  Use malloc(3) only if
RUMP_USE_UNREAL_ALLOCATORS is defined.

Revision 1.1 / (download) - annotate - [select for diffs], Wed Nov 4 20:38:58 2009 UTC (14 years, 5 months ago) by pooka
Branch: MAIN

Pull all relegating memory allocators under a common roof in memalloc.c
(forgot to commit the new file)

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>