From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f71.google.com (mail-oi0-f71.google.com [209.85.218.71]) by kanga.kvack.org (Postfix) with ESMTP id 332F48E0001 for ; Fri, 14 Sep 2018 13:25:11 -0400 (EDT) Received: by mail-oi0-f71.google.com with SMTP id q11-v6so10304239oih.15 for ; Fri, 14 Sep 2018 10:25:11 -0700 (PDT) Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id m5-v6sor3033109otm.148.2018.09.14.10.25.09 for (Google Transport Security); Fri, 14 Sep 2018 10:25:09 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20180914131618.GD27141@lst.de> References: <153680531988.453305.8080706591516037706.stgit@dwillia2-desk3.amr.corp.intel.com> <153680533706.453305.3428304103990941022.stgit@dwillia2-desk3.amr.corp.intel.com> <20180914131618.GD27141@lst.de> From: Dan Williams Date: Fri, 14 Sep 2018 10:25:09 -0700 Message-ID: Subject: Re: [PATCH v5 3/7] mm, devm_memremap_pages: Fix shutdown handling Content-Type: text/plain; charset="UTF-8" Sender: owner-linux-mm@kvack.org List-ID: To: Christoph Hellwig Cc: Andrew Morton , stable , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Logan Gunthorpe , Alexander Duyck , Linux MM , Linux Kernel Mailing List On Fri, Sep 14, 2018 at 6:16 AM, Christoph Hellwig wrote: >> An argument could be made to require that the ->kill() operation be set >> in the @pgmap arg rather than passed in separately. However, it helps >> code readability, tracking the lifetime of a given instance, to be able >> to grep the kill routine directly at the devm_memremap_pages() call >> site. > > I generally do not like passing redundant argument, and I don't really > see why this case is different. Or in other ways I'd like to make > your above argument.. Logan had similar feedback, and now the chorus is getting louder. I personally like how I can do this with grep: drivers/dax/pmem.c:114: addr = devm_memremap_pages(dev, &dax_pmem->pgmap, dax_pmem_percpu_kill); -- drivers/nvdimm/pmem.c:411: addr = devm_memremap_pages(dev, &pmem->pgmap, drivers/nvdimm/pmem.c-412- pmem_freeze_queue); -- drivers/nvdimm/pmem.c:425: addr = devm_memremap_pages(dev, &pmem->pgmap, drivers/nvdimm/pmem.c-426- pmem_freeze_queue); -- mm/hmm.c:1059: result = devm_memremap_pages(devmem->device, &devmem->pagemap, mm/hmm.c-1060- hmm_devmem_ref_kill); -- mm/hmm.c:1113: result = devm_memremap_pages(devmem->device, &devmem->pagemap, mm/hmm.c-1114- hmm_devmem_ref_kill); ...and see all of the kill() variants, but the redundancy will likely continue to bother folks. > Except for that the patch looks good to me. Thanks, I'll fix it up to drop the redundant arg.