lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 16 Apr 2018 14:43:01 +0200
From:   Vitaly Wool <vitalywool@...il.com>
To:     Guenter Roeck <linux@...ck-us.net>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        mawilcox@...rosoft.com, asavery@...omium.org, gwendal@...omium.org
Subject: Re: Crashes/hung tasks with z3pool under memory pressure

Hey Guenter,

On 04/13/2018 07:56 PM, Guenter Roeck wrote:

> On Fri, Apr 13, 2018 at 05:40:18PM +0000, Vitaly Wool wrote:
>> On Fri, Apr 13, 2018, 7:35 PM Guenter Roeck <linux@...ck-us.net> wrote:
>>
>>> On Fri, Apr 13, 2018 at 05:21:02AM +0000, Vitaly Wool wrote:
>>>> Hi Guenter,
>>>>
>>>>
>>>> Den fre 13 apr. 2018 kl 00:01 skrev Guenter Roeck <linux@...ck-us.net>:
>>>>
>>>>> Hi all,
>>>>> we are observing crashes with z3pool under memory pressure. The kernel
>>>> version
>>>>> used to reproduce the problem is v4.16-11827-g5d1365940a68, but the
>>>> problem was
>>>>> also seen with v4.14 based kernels.
>>>>
>>>> just before I dig into this, could you please try reproducing the errors
>>>> you see with https://patchwork.kernel.org/patch/10210459/ applied?
>>>>
>>> As mentioned above, I tested with v4.16-11827-g5d1365940a68, which already
>>> includes this patch.
>>>
>> Bah. Sorry. Expect an update after the weekend.
>>
> NP; easy to miss. Thanks a lot for looking into it.
>
I wonder if the following patch would make a difference:

diff --git a/mm/z3fold.c b/mm/z3fold.c
index c0bca6153b95..5e547c2d5832 100644
--- a/mm/z3fold.c
+++ b/mm/z3fold.c
@@ -887,19 +887,21 @@ static int z3fold_reclaim_page(struct z3fold_pool *pool, unsigned int retries)
  				goto next;
  		}
  next:
-		spin_lock(&pool->lock);
  		if (test_bit(PAGE_HEADLESS, &page->private)) {
  			if (ret == 0) {
-				spin_unlock(&pool->lock);
  				free_z3fold_page(page);
  				return 0;
  			}
-		} else if (kref_put(&zhdr->refcount, release_z3fold_page)) {
-			atomic64_dec(&pool->pages_nr);
-			spin_unlock(&pool->lock);
-			return 0;
+		} else {
+			spin_lock(&zhdr->page_lock);
+			if (kref_put(&zhdr->refcount, release_z3fold_page_locked)) {
+				atomic64_dec(&pool->pages_nr);
+				return 0;
+			}
+			spin_unlock(&zhdr->page_lock);
  		}
  
+		spin_lock(&pool->lock);
  		/*
  		 * Add to the beginning of LRU.
  		 * Pool lock has to be kept here to ensure the page has


Thanks,
    Vitaly

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ