Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp637369imm; Fri, 31 Aug 2018 09:14:23 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbmxSnAMt7pa62BJzHrvNUvKjEUrob12v+QUa24JZiZdifT5CSgh3fSvwaHDeeoxi/WHS3z X-Received: by 2002:a17:902:b492:: with SMTP id y18-v6mr11773956plr.208.1535732063370; Fri, 31 Aug 2018 09:14:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535732063; cv=none; d=google.com; s=arc-20160816; b=dIGBSfMo82gc4bGZzWMIRcW3MeeWYtAb0wLoGtSZHWv3IS0W1R6XR9s2HTm5D2HG0d 2lX4qwiyXLmmGf6zjabKBVte1LKgUD/S/Uwy2sKDXANgX5NC58ELT321mEeutd7Jl8D+ m4/2KJ3wW0ZF3dzLgGxyQp0DK3BSjugSVoy+itpIoSkqPJWgvJswTCALKrauDldwwuoI wyUfixusz97UK9WXRvrbygu4hz+LIIc4PCPbyAjYQr8dHfP3UIhjd3Bcwx8Vc1xxREbO g4ZSZjDjLViirNaiPy5N6T42u+7Fftj5SLyLxE43AMj5fw9fOzVAheUj7hLUPzq67zTa werQ== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=EOyGS6MFo/l2FfJYPXbaZ6SIvBgKmIKWVojT/+Ymj9A=; b=0ZG8avFTSNG5dIlSn8F1t6YWqcWlWgBijms9HaQqbjH1TbXA04ENa5eKM9yYoljQEg Fpc4ljEHHluXSVAYz4/QYYdUTJlNNLqc9uj1ZnggLZi8OulhfxgpJL0peuvxQ6JxaG0H MOZ4cUKDRerpUjiFfOzeyRdMJA+JKRSdJhZDoN9j19jBYU3zNJWXTxqby5ZRQKxA9KbX hskBBVuM3sk3xXllZIz3AOak43SeOPymyWNc8h/ZGsjpluJqgG7qDmVUjqM0rKTKgaBR HJHNPTcpQvl5WQ/DEQtFyDDExaNlOK3uulKCdckBnPcDPy+yy3DcbNCI64sVwd3sCCpT frbQ== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s32-v6si10312564pgl.531.2018.08.31.09.14.08; Fri, 31 Aug 2018 09:14: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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729260AbeHaUUq (ORCPT + 99 others); Fri, 31 Aug 2018 16:20:46 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:56086 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728502AbeHaUUp (ORCPT ); Fri, 31 Aug 2018 16:20:45 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 54F7D2E9BF; Fri, 31 Aug 2018 16:12:32 +0000 (UTC) Received: from redhat.com (ovpn-123-69.rdu2.redhat.com [10.10.123.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E0A2F2027EA0; Fri, 31 Aug 2018 16:12:31 +0000 (UTC) Date: Fri, 31 Aug 2018 12:12:30 -0400 From: Jerome Glisse To: Balbir Singh Cc: linux-mm@kvack.org, Andrew Morton , linux-kernel@vger.kernel.org, Ralph Campbell , John Hubbard Subject: Re: [PATCH 5/7] mm/hmm: use a structure for update callback parameters Message-ID: <20180831161230.GA4111@redhat.com> References: <20180824192549.30844-1-jglisse@redhat.com> <20180824192549.30844-6-jglisse@redhat.com> <20180830231148.GC28695@350D> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180830231148.GC28695@350D> User-Agent: Mutt/1.10.0 (2018-05-17) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 31 Aug 2018 16:12:32 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 31 Aug 2018 16:12:32 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jglisse@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 31, 2018 at 09:11:48AM +1000, Balbir Singh wrote: > On Fri, Aug 24, 2018 at 03:25:47PM -0400, jglisse@redhat.com wrote: > > From: J?r?me Glisse > > > > Use a structure to gather all the parameters for the update callback. > > This make it easier when adding new parameters by avoiding having to > > update all callback function signature. > > > > Signed-off-by: J?r?me Glisse > > Cc: Ralph Campbell > > Cc: John Hubbard > > Cc: Andrew Morton > > --- > > include/linux/hmm.h | 25 +++++++++++++++++-------- > > mm/hmm.c | 27 ++++++++++++++------------- > > 2 files changed, 31 insertions(+), 21 deletions(-) > > > > diff --git a/include/linux/hmm.h b/include/linux/hmm.h > > index 1ff4bae7ada7..a7f7600b6bb0 100644 > > --- a/include/linux/hmm.h > > +++ b/include/linux/hmm.h > > @@ -274,13 +274,26 @@ static inline uint64_t hmm_pfn_from_pfn(const struct hmm_range *range, > > struct hmm_mirror; > > > > /* > > - * enum hmm_update_type - type of update > > + * enum hmm_update_event - type of update > > * @HMM_UPDATE_INVALIDATE: invalidate range (no indication as to why) > > */ > > -enum hmm_update_type { > > +enum hmm_update_event { > > HMM_UPDATE_INVALIDATE, > > }; > > > > +/* > > + * struct hmm_update - HMM update informations for callback > > + * > > + * @start: virtual start address of the range to update > > + * @end: virtual end address of the range to update > > + * @event: event triggering the update (what is happening) > > + */ > > +struct hmm_update { > > + unsigned long start; > > + unsigned long end; > > + enum hmm_update_event event; > > +}; > > + > > I wonder if you want to add further information about the range, > like page_size, I guess the other side does not care about the > size. Do we care about sending multiple discontig ranges in > hmm_update? Should it be an array? > > Balbir Singh This is a range of virtual address if a huge page is fully unmapped then the range will cover the full huge page. It mirror mmu notifier range callback because 99% of the time it is just use to pass down mmu notifier invalidation. So we don't care about multi range at least not yet. Nor do we care about page size as it might vary in the range (range can have a mix of THP and regular page) moreover the device driver usualy ignore the page size. Cheers, J?r?me