Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libperfuse perfuse memory usage can grow quite large whe...
details: https://anonhg.NetBSD.org/src/rev/b44b62a2e1f8
branches: trunk
changeset: 770560:b44b62a2e1f8
user: manu <manu%NetBSD.org@localhost>
date: Sun Oct 23 05:01:00 2011 +0000
description:
perfuse memory usage can grow quite large when using a lot of vnodes,
and the amount of data memory involved is not easy to forcast. We therefore
raise the limit to the maximum.
Patch from Manuel Bouyer. It helps completing a cvs update on a glusterfs
colume.
diffstat:
lib/libperfuse/perfuse.c | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
diffs (40 lines):
diff -r 16ebcef8b44a -r b44b62a2e1f8 lib/libperfuse/perfuse.c
--- a/lib/libperfuse/perfuse.c Sat Oct 22 22:23:50 2011 +0000
+++ b/lib/libperfuse/perfuse.c Sun Oct 23 05:01:00 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: perfuse.c,v 1.21 2011/10/18 15:47:32 manu Exp $ */
+/* $NetBSD: perfuse.c,v 1.22 2011/10/23 05:01:00 manu Exp $ */
/*-
* Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -34,6 +34,7 @@
#include <puffs.h>
#include <sys/types.h>
#include <sys/mman.h>
+#include <sys/resource.h>
#include <sys/socket.h>
#include <sys/extattr.h>
#include <sys/un.h>
@@ -399,6 +400,22 @@
unsigned int puffs_flags;
struct puffs_node *pn_root;
struct puffs_pathobj *po_root;
+ struct rlimit rl;
+
+ /*
+ * perfused can grow quite large, let assume there's enough ram ...
+ */
+ if (getrlimit(RLIMIT_DATA, &rl) < 0) {
+ DERR(EX_OSERR, "%s: getrlimit failed: %s", __func__,
+ strerror(errno));
+ } else {
+ rl.rlim_cur = rl.rlim_max;
+ if (setrlimit(RLIMIT_DATA, &rl) < 0) {
+ DERR(EX_OSERR, "%s: setrlimit failed: %s", __func__,
+ strerror(errno));
+ }
+ }
+
ps = init_state();
ps->ps_owner_uid = pmi->pmi_uid;
Home |
Main Index |
Thread Index |
Old Index