Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2889702imm; Fri, 19 Oct 2018 01:11:59 -0700 (PDT) X-Google-Smtp-Source: ACcGV63xW0G9f7vGD/eqlcV+L+OVbI/mESKpFzlxp/A+sEI9U/tZzsgTIDwD0YsCCqI905Bth5HS X-Received: by 2002:a63:4c23:: with SMTP id z35-v6mr32053290pga.312.1539936719126; Fri, 19 Oct 2018 01:11:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539936719; cv=none; d=google.com; s=arc-20160816; b=z3NYgyftVQhy5LubpAR8dprA9IRhPo9ySs2yPeymTPygM64Dl6sLHK7kHgbj3nqA7L sruAOeq8CnlFhd0r5WiZnjGUON8g4Chl6DPRblvk7cYhjz30C/XssGVrB2PvKp10nkmz jmjhDE1ytrOH49h7CKnkbf7bCWAqgHR5USBwZzcmbVZzT0zybw8FyhBKxtobzL4jiDFV vlOEAp+MQhjGDLJzLDHU5rxc2KMK6/XdgW4cZ5DLeYF2ifdLVLyQoR/P/+5v12GmJ3hk lEEom5u+9eowPwiuDic1/4DEH4jYnFGJNQwlh5BlTtn4MyTD87UrvEq/9z+/eRHd0/Ts IM3w== 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=tF5cFWZalqmfs4WaHBPsaPC8bp5wV9k8m1H38pEPQKI=; b=B7HCN7QA3J+myHUIaI97Ben5XmVAtnW/7CRGCk2jnTPwnPjdsD+wKC2A/wy7vSEc8S Jepj5pdRw4iAIAf15VngjvS3JKIFNjQ9PHH3ZD/PysKmDuHD54HFZWCt3PKD4UVKfxmG CGSMT8eo/kSIdKGA6Mh2Cee+Fqdjoh+PDTkdtZT08d7U/l58rsm7L1d7n+8LkQ1iY62i IP0aIxEi7xZTxgysU6DuBvp3XL4/fk1+3BJ5szbSqHWpwhrt+zQN8BYWJCvAekRtpliE Nrz55pWv3enUvdk/+EykU3F7t78ewQ01zKtFUQe4Tb8g87Vud4KhA14EDk6wkjae5hvg vhhg== 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 t187-v6si24127089pfd.148.2018.10.19.01.11.43; Fri, 19 Oct 2018 01:11:59 -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 S1727243AbeJSQQR (ORCPT + 99 others); Fri, 19 Oct 2018 12:16:17 -0400 Received: from mx2.suse.de ([195.135.220.15]:60322 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726609AbeJSQQR (ORCPT ); Fri, 19 Oct 2018 12:16:17 -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 81068AD75; Fri, 19 Oct 2018 08:11:16 +0000 (UTC) Date: Fri, 19 Oct 2018 10:11:15 +0200 From: Michal Hocko To: John Hubbard Cc: Jan Kara , Dave Chinner , Matthew Wilcox , Christopher Lameter , Jason Gunthorpe , Dan Williams , linux-mm@kvack.org, Andrew Morton , LKML , linux-rdma , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 4/6] mm: introduce page->dma_pinned_flags, _count Message-ID: <20181019081115.GM18839@dhcp22.suse.cz> References: <20181012060014.10242-1-jhubbard@nvidia.com> <20181012060014.10242-5-jhubbard@nvidia.com> <20181013035516.GA18822@dastard> <7c2e3b54-0b1d-6726-a508-804ef8620cfd@nvidia.com> <20181013230124.GB18822@dastard> <20181016085102.GB18918@quack2.suse.cz> <20181017110952.GN18839@dhcp22.suse.cz> <2367ff26-809c-da94-a8f0-e921bdc4862a@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2367ff26-809c-da94-a8f0-e921bdc4862a@nvidia.com> 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 Wed 17-10-18 17:03:03, John Hubbard wrote: > On 10/17/18 4:09 AM, Michal Hocko wrote: > > On Tue 16-10-18 18:48:23, John Hubbard wrote: > > [...] > >> It's hard to say exactly what the active/inactive/unevictable list should > >> be when DMA is done and put_user_page*() is called, because we don't know > >> if some device read, wrote, or ignored any of those pages. Although if > >> put_user_pages_dirty() is called, that's an argument for "active", at least. > > > > Any reason to not use putback_lru_page? > > That does help with which LRU to use. I guess I'd still need to track whether > a page was on an LRU when get_user_pages() was called, because it seems > that that is not necessarily always the case. And putback_lru_page() definitely > wants to deal with a page that *was* previously on an LRU. Well, if you ever g-u-p pages which are never going to go to LRU then sure (e.g. hugetlb pages). -- Michal Hocko SUSE Labs