Date: Sat, 10 Nov 2012 12:06:36 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242859 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <201211101206.qAAC6aB1002617@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Sat Nov 10 12:06:36 2012 New Revision: 242859 URL: http://svnweb.freebsd.org/changeset/base/242859 Log: MFC r241773: zfs: wait in arc_lowmem only if curproc == pageproc Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Nov 10 12:06:24 2012 (r242858) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Nov 10 12:06:36 2012 (r242859) @@ -3718,8 +3718,16 @@ arc_lowmem(void *arg __unused, int howto mutex_enter(&arc_reclaim_thr_lock); needfree = 1; cv_signal(&arc_reclaim_thr_cv); - while (needfree) - msleep(&needfree, &arc_reclaim_thr_lock, 0, "zfs:lowmem", 0); + + /* + * It is unsafe to block here in arbitrary threads, because we can come + * here from ARC itself and may hold ARC locks and thus risk a deadlock + * with ARC reclaim thread. + */ + if (curproc == pageproc) { + while (needfree) + msleep(&needfree, &arc_reclaim_thr_lock, 0, "zfs:lowmem", 0); + } mutex_exit(&arc_reclaim_thr_lock); mutex_exit(&arc_lowmem_lock); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211101206.qAAC6aB1002617>