Received: by 2002:ac0:950e:0:0:0:0:0 with SMTP id f14csp301799imc; Sat, 16 Mar 2019 01:25:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwPAJx6JM10wST9tRDVPYSN4uNoSW8GBhbJF56iSB4XCUAEQSscWJYwUmH4kSRTo09nutnz X-Received: by 2002:a17:902:1621:: with SMTP id g30mr8696017plg.116.1552724723944; Sat, 16 Mar 2019 01:25:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552724723; cv=none; d=google.com; s=arc-20160816; b=smiKCAe/FCWtDe3zoUQGBRC8L6FGnhXMoyb467pIKsqqiDe7GNyWp5v1MPui/WkmWa gb4/Y7XhFAJ7/swWR6vFJiCFkaeq3TNzUbqlT+73eY6agk8EX1XiFxIksiYqaLXfLPLl YS1UrCpP/BHBogTa8t/icPUaltGLfFij6mobC6Un3Zk+8W4b0kMJPwir+BasarXFoJm5 moPmNGZ6hMNsG3ifcWSUjB/wVxqCvdH+SzwoH0CjKy/3SQN0qv92k09vLULCMCkYtW0b 19Ha2eAGtkvYB1SFwk8MzAgqZbQkLc8nwGOW4G5xnAvxzZAcCOZnmYx7EW6vKUuaF84T /ZzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=i2kcYL2mo3eoiQe4HbkfAUlUJ5Ud0yU1T8CG2rspfHw=; b=ApyU5Vk0pMVgW4QfzwRK89+8KgQZPfcCQDcqJpZfE0hQVfw8TdP45GVDkAHPEcp7qa byAMqMrK2HhmxtgTl5QW9ZSy4cQm9egDXnwoJuqXhDpNlebxhD+We7xw7DZE005hpuiW bZsr1M+7nd5C29c/8cKLB3gKP6pO42dafYWo7P+xSlEjntN8JOhdZQrf/iNzDxw5yTdd lQyl7c68vPv6WgpXQp6HwL9P50JymAcO4L7ZxbssSgOvgw6XNs2MIyKMWniEIOpJIFe1 Wm3lxxr3wioQxyWR29K2pZJt9gRUtRSg56WVvrCOdNESk+MpBfGvqFtxg+c+JUwizEkw o2GA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w24si3803032ply.32.2019.03.16.01.24.56; Sat, 16 Mar 2019 01:25:23 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726549AbfCPIX5 (ORCPT + 99 others); Sat, 16 Mar 2019 04:23:57 -0400 Received: from mx2.suse.de ([195.135.220.15]:33438 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726048AbfCPIX5 (ORCPT ); Sat, 16 Mar 2019 04:23:57 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id A4B91AD3B; Sat, 16 Mar 2019 08:23:55 +0000 (UTC) Date: Sat, 16 Mar 2019 09:23:54 +0100 From: Michal Hocko To: Oscar Salvador Cc: akpm@linux-foundation.org, anshuman.khandual@arm.com, william.kucharski@oracle.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Jan Kara , Hugh Dickins Subject: Re: [PATCH] mm: Fix __dump_page when mapping->host is not set Message-ID: <20190316082354.GF15672@dhcp22.suse.cz> References: <20190315121826.23609-1-osalvador@suse.de> <20190315124733.GE15672@dhcp22.suse.cz> <20190315143304.pkuvj4qwtlzgm7iq@d104.suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190315143304.pkuvj4qwtlzgm7iq@d104.suse.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 15-03-19 15:33:07, Oscar Salvador wrote: > On Fri, Mar 15, 2019 at 01:47:33PM +0100, Michal Hocko wrote: > > diff --git a/mm/debug.c b/mm/debug.c > > index 1611cf00a137..499c26d5ebe5 100644 > > --- a/mm/debug.c > > +++ b/mm/debug.c > > @@ -78,6 +78,9 @@ void __dump_page(struct page *page, const char *reason) > > else if (PageKsm(page)) > > pr_warn("ksm "); > > else if (mapping) { > > + if (PageSwapCache(page)) > > + mapping = page_swap_info(page)->swap_file->f_mapping; > > + > > pr_warn("%ps ", mapping->a_ops); > > if (mapping->host->i_dentry.first) { > > struct dentry *dentry; > > This looks like a much nicer fix, indeed. If we go this way then we should swap the order and print the mapping before we alter it. > I gave it a spin and it works. Thanks for testing! > Since the mapping is set during the swapon, I would assume that this should > always work for swap. > Although I am not sure if once you start playing with e.g zswap the picture can > change. > > Let us wait for Hugh and Jan. Yes, I really cannot tell this is really safe. Maybe we want to do the check for host anyway. Just to be sure. -- Michal Hocko SUSE Labs