Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4251236ybe; Mon, 9 Sep 2019 06:38:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqyqTN0bNbIyvFJhh3/LwiCxp8PzDfmHBRH39xCfZaX3RoKQ/58XCOBipk2JXLGYHZ6MJAnW X-Received: by 2002:a17:906:f1d5:: with SMTP id gx21mr19264584ejb.162.1568036316636; Mon, 09 Sep 2019 06:38:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568036316; cv=none; d=google.com; s=arc-20160816; b=OMZ23DLG6qNRbdzzmB6J88cfik0tOz+GR0ZDA2Zks9NMA/ZgLii60IGBXlc79j9IQW TiYB7t/C9PegBn7QFNZZtej/5LjiSJ0yboOAOeSXLPJVT6/TUF96qZOZj2xtQFBx/O/L uP+hH3RvUC95LZG15BExpS8IGuCoV9MToFxUFo1qBkqmkQYFUvnWV1egY8SxxGEIEcsX QsJtUJmBQpJlU/3Jqlr29iHTFucFJYHVR70LIFtT68mmQs3nId+49nqeUg1X2wocpldE roO2TqhqDdQolsEoEDOv0fOsSv9ipcGm/kEDONHbKhOBrJYNtZ+qLvzGpR8/ZTxorja9 L6aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=1juM/iMQ96QooUUt3f77LO+IV8A/P1jdeBRL84BbUZU=; b=BrSWLMQa7RunSAJnlA0FpvZsXCCL9I0B84fzs8Enc+WvesK+vpAnE6MT3K/8DKzfrG 9TO2npLENvNf86rSdlKWdPoqouycQtgm8j5sjT2GvEnqRZN4HamB6t1vD0GvL/cA/1yw fJEMCSrAquzRBICXRKvl4SBF+9rECDWrJj0Sxd1winRVlRVGzRqLB3Z+TzU6c0CVtmOc GYUFn43gVFhqLQEn5jmzE0KdYNjPWia2+sgu6zsmhyNMC+zg/u7EGcE1PSlMP0nemNgC 9ZrXHHJrvmwHChd8ObN0/MjUvn4kIM+HhHFovs1VN8htZh4fEMokMC4jlhRjYCXmXAFG Cg/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vd8B1p6v; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a19si7178740ejj.73.2019.09.09.06.38.12; Mon, 09 Sep 2019 06:38:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vd8B1p6v; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729825AbfIHUor (ORCPT + 99 others); Sun, 8 Sep 2019 16:44:47 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:42199 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729263AbfIHUor (ORCPT ); Sun, 8 Sep 2019 16:44:47 -0400 Received: by mail-lj1-f196.google.com with SMTP id y23so10688669lje.9 for ; Sun, 08 Sep 2019 13:44:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1juM/iMQ96QooUUt3f77LO+IV8A/P1jdeBRL84BbUZU=; b=vd8B1p6vAgV+BtAIEf0xv0O+Y4Vm/xhVfRv4TU+EyRD9QBl/R8GaZu4HLoGkEtk5e6 oHp0+VcNHewZ4JRNXZRhAZEwgrV2uESOmdeVVr3fytPmTmBj9rhHIhz3jtvUAgBH5jjt SOImtUAKCMn/kRf5v1wa2/0dld4ICc+ZUEV+fF0u5sX5a+D2yUPsDZZHFXtYwqGguiyr UAWhgas7L840y2sXbDf+W2jJwY9UeFTBpR4NA6fWqRODuARyElMF3+m2TfA8jgSnahjW dUbg9pmU3ftyKRD6vOcUGDoN+bvtJ2C+b0rujLRZ5YdyNQpbJu5ahSir2rFBEtLpGUqC wvtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1juM/iMQ96QooUUt3f77LO+IV8A/P1jdeBRL84BbUZU=; b=mIqb1ZKxvik5qLokJcI7gEZKksa0IPqehQZ1z/QYBKpC+Dmwy+kG4XYjTSR9Wz9Wtv unLqoHGJI+Tz39OJxrzbf46agt6FIsXIu3WuG387Mch1SXZxNR9OqLrzAVxUBCyg1lpu +FvCCyT0J/tYdCTuZaTGyfnuA/zVFjnv3qvn9FV2/jbqSY8FOB28jilSeIIAQ3dBI4gS ohJiU24liQhkZljaHe0vRxsoUf+SQQNC0SVQ87CUNe3RYMz41uOIBu6AydvX/JtaB5Ht uVoRpS6kCM2PHKRUC2Mqv7TMGBq4i2aVWFdERru6jgzID5duV1l9gFA8oKuhksLQL727 Il5w== X-Gm-Message-State: APjAAAXgp9CN9hYrFWFJTyJ6PBjk/+stunKCBFooad6IuCS+px0egnh6 wxVZDqKIwsBeotM0YIatIXhGSNVM3Tzk13/Iae7TDV8V X-Received: by 2002:a2e:90c7:: with SMTP id o7mr13234884ljg.73.1567975485166; Sun, 08 Sep 2019 13:44:45 -0700 (PDT) MIME-Version: 1.0 References: <20190908162919.830388dc7404d1e2c80f4095@gmail.com> <1ed46a95-12bc-d8ee-0770-43057a09f0d9@maciej.szmigiero.name> In-Reply-To: <1ed46a95-12bc-d8ee-0770-43057a09f0d9@maciej.szmigiero.name> From: Vitaly Wool Date: Sun, 8 Sep 2019 23:44:33 +0300 Message-ID: Subject: Re: [PATCH] z3fold: fix retry mechanism in page reclaim To: "Maciej S. Szmigiero" Cc: Linux-MM , Andrew Morton , LKML , =?UTF-8?Q?Agust=C3=ADn_Dall=CA=BCAlba?= , Dan Streetman , Vlastimil Babka , Markus Linnala Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 8, 2019 at 4:56 PM Maciej S. Szmigiero wrote: > > On 08.09.2019 15:29, Vitaly Wool wrote: > > z3fold_page_reclaim()'s retry mechanism is broken: on a second > > iteration it will have zhdr from the first one so that zhdr > > is no longer in line with struct page. That leads to crashes when > > the system is stressed. > > > > Fix that by moving zhdr assignment up. > > > > While at it, protect against using already freed handles by using > > own local slots structure in z3fold_page_reclaim(). > > > > Reported-by: Markus Linnala > > Reported-by: Chris Murphy > > Reported-by: Agustin Dall'Alba > > Signed-off-by: Vitaly Wool > > --- > > Shouldn't this be CC'ed to stable@ ? I guess :) Thanks, Vitaly