From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752181AbbJWD0p (ORCPT ); Thu, 22 Oct 2015 23:26:45 -0400 Received: from mail113-249.mail.alibaba.com ([205.204.113.249]:32965 "EHLO us-alimail-mta1.hst.scl.en.alidc.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751074AbbJWD0o (ORCPT ); Thu, 22 Oct 2015 23:26:44 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R551e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e02c03270;MF=hillf.zj@alibaba-inc.com;NM=1;PH=DS;RN=3;SR=0; Reply-To: "Hillf Danton" From: "Hillf Danton" To: "'Jerome Glisse'" Cc: "'linux-kernel'" , References: <062101d10cae$91d986d0$b58c9470$@alibaba-inc.com> <20151022142618.GC2914@redhat.com> In-Reply-To: <20151022142618.GC2914@redhat.com> Subject: Re: [PATCH v11 07/14] HMM: mm add helper to update page table when migrating memory v2. Date: Fri, 23 Oct 2015 11:25:54 +0800 Message-ID: <071501d10d42$86fd39c0$94f7ad40$@alibaba-inc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQFlbZnKAIEJ8SmMPWxbRbWe8iDLiAEGM2i5n0d36WA= Content-Language: zh-cn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > > This is a multi-stage process, first we save and replace page table > > > entry with special HMM entry, also flushing tlb in the process. If > > > we run into non allocated entry we either use the zero page or we > > > allocate new page. For swaped entry we try to swap them in. > > > > > Please elaborate why swap entry is handled this way. > > So first, this is only when you have a device then use HMM and a device > that use memory migration. So far it only make sense for discrete GPUs. > So regular workload that do not use a GPUs with HMM are not impacted and > will not go throught this code path. > > Now, here we are migrating memory because the device driver is asking for > it, so presumably we are expecting that the device will use that memory > hence we want to swap in anything that have been swap to disk. Once it is > swap in memory we copy it to device memory and free the pages. So in the > end we only need to allocate a page temporarily until we move things to > the device. > I prefer it is in log message. thanks Hillf