From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1951746AbdEACpP (ORCPT ); Sun, 30 Apr 2017 22:45:15 -0400 Received: from mail-io0-f181.google.com ([209.85.223.181]:36670 "EHLO mail-io0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1165129AbdEACpK (ORCPT ); Sun, 30 Apr 2017 22:45:10 -0400 MIME-Version: 1.0 In-Reply-To: <20170429141838.tkyfxhldmwypyipz@gmail.com> References: <20170428063913.iz6xjcxblecofjlq@gmail.com> <149339998297.24933.1129582806028305912.stgit@dwillia2-desk3.amr.corp.intel.com> <20170429141838.tkyfxhldmwypyipz@gmail.com> From: Dan Williams Date: Sun, 30 Apr 2017 19:45:08 -0700 Message-ID: Subject: Re: [PATCH v2] mm, zone_device: replace {get, put}_zone_device_page() with a single reference To: Ingo Molnar Cc: "linux-kernel@vger.kernel.org" , Linux MM , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Ingo Molnar , Andrew Morton , Logan Gunthorpe , Kirill Shutemov Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v412jqap007655 On Sat, Apr 29, 2017 at 7:18 AM, Ingo Molnar wrote: > > * Dan Williams wrote: > >> Kirill points out that the calls to {get,put}_dev_pagemap() can be >> removed from the mm fast path if we take a single get_dev_pagemap() >> reference to signify that the page is alive and use the final put of the >> page to drop that reference. >> >> This does require some care to make sure that any waits for the >> percpu_ref to drop to zero occur *after* devm_memremap_page_release(), >> since it now maintains its own elevated reference. >> >> Cc: Ingo Molnar >> Cc: Jérôme Glisse >> Cc: Andrew Morton >> Reviewed-by: Logan Gunthorpe >> Suggested-by: Kirill Shutemov >> Tested-by: Kirill Shutemov >> Signed-off-by: Dan Williams > > This changelog is lacking an explanation about how this solves the crashes you > were seeing. > Kirill? It wasn't clear to me why the conversion to generic get_user_pages_fast() caused the reference counts to be off.