Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Apr 2015 11:11:42 +0200
From:      Svatopluk Kraus <onwahe@gmail.com>
To:        freebsd-current@freebsd.org, alc@freebsd.org
Subject:   [patch] deadlock in vm_reserv_reclaim_contig()
Message-ID:  <CAFHCsPWEhugZP6ZyFLD%2Bf-h721HBmY-7FzJdRV0yj3b0VH6N8A@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
--20cf301d426818248105135b27c8
Content-Type: text/plain; charset=UTF-8

Hi,

my RPI-B has been stuck in vm_reserv_reclaim_contig() due to a bug
within that function. I can reproduce that easily on my two-core
pandaboard when I limit all memory in system to 128MiB and run "make
-j16 kernel-toolchain". It happens in few seconds.

The patch should be self-explanatory. The problem is that there is a
free page found in reservation which does not fulfill alignment
requirement, thus next free page should be looked for. However, due to
the bug, the same free page is found out again and again.

The patch takes into account that shift by m on n-bit arch has an
undefined behaviour if m >= n.

Svatopluk Kraus

--20cf301d426818248105135b27c8
Content-Type: text/plain; charset=US-ASCII; name="vm_reserv.diff"
Content-Disposition: attachment; filename="vm_reserv.diff"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_i8bdhsa70

SW5kZXg6IHN5cy92bS92bV9yZXNlcnYuYwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBzeXMvdm0vdm1fcmVzZXJ2
LmMJKHJldmlzaW9uIDI4MTI5MikKKysrIHN5cy92bS92bV9yZXNlcnYuYwkod29ya2luZyBjb3B5
KQpAQCAtOTgzLDggKzk4MywxMiBAQAogCQkJCWJyZWFrOwogCQkJfSBlbHNlIGlmICgocGEgJiAo
YWxpZ25tZW50IC0gMSkpICE9IDAgfHwKIAkJCSAgICAoKHBhIF4gKHBhICsgc2l6ZSAtIDEpKSAm
IH4oYm91bmRhcnkgLSAxKSkgIT0gMCkgewotCQkJCS8qIENvbnRpbnVlIHdpdGggdGhpcyByZXNl
cnZhdGlvbi4gKi8KLQkJCQloaSA9IGxvOworCQkJCS8qIENvbnRpbnVlIHdpdGggdGhpcyBvciBu
ZXh0IHJlc2VydmF0aW9uLiAqLworCQkJCWhpID0gbG8gKyAxOworCQkJCWlmIChoaSA+PSBOQlBP
UE1BUCkgeworCQkJCQloaSA9IDA7CisJCQkJCWkrKzsKKwkJCQl9CiAJCQkJY29udGludWU7CiAJ
CQl9CiAJCQkvKiBGaW5kIHRoZSBuZXh0IHVzZWQgcGFnZS4gKi8K
--20cf301d426818248105135b27c8--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFHCsPWEhugZP6ZyFLD%2Bf-h721HBmY-7FzJdRV0yj3b0VH6N8A>