Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2443279imd; Fri, 2 Nov 2018 11:28:36 -0700 (PDT) X-Google-Smtp-Source: AJdET5d8Lj4BJOpBDGx/mH1yLXK9bcnxh0+DMt3tUQW+rG4vnLQpCaf9pxu17Z8n9/qC6VgCj0LJ X-Received: by 2002:a63:e54d:: with SMTP id z13-v6mr11719457pgj.169.1541183316321; Fri, 02 Nov 2018 11:28:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541183316; cv=none; d=google.com; s=arc-20160816; b=RG/OyvlVj2QAyg9RhQtjEXPb72PVoJKq6ojkvKPfCj1RVwb+zFe/ThsZ22CxWTcooj QjR0tFSrMcTzORBKCsEQVWNCoqaGUA4PN9BqbiPqs3TVS8DCrpCgW81Qjqzx0ffE/mQL NxFwI9oj35EyWYfDQy8gK3xA5fuJfdFStnv3CLcUHJXoWEIZFEwAV9gxle2WdRXbX+pJ xY7ibzTALTis+/ii6Vk9nq8W49d9cm4OalFpABlG5l5lgIQadNsmzuXVtjRAA9gSDLLg 68RXUW7X1jqG2k9ygG/e0/Ce7BDvYZRBwYq1/ZiD/lH1lO+CLHd+3FS3dMZHbPVKktWG sqXQ== 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=mWjc64c3e9Jga3f12yL9oF3vLli+WJrg9hz0RsMG1O0=; b=wra5U8d+S9DorvsK5+QmS/Qu3LqbwlC4qisVDeZ+QATLfbMt8zd+V9dVLzrDUMEqEf otyk+fqLjmYf6XzEyXXepdWXWHBEr91szbA/k89P/iNIuxyRUPHDz0obvFnxO6pOczss n8U4+KBnJEgS2K05xkTuMR+p/sutiIWzjCXPuMaqA4DXVgCONFckHFZqGZMY6zEHWXk+ x93a55CMmMQ66EpC/stj7xXDTI9eTlfna7/T5kAfF+K0huEVjjuJTiNZzO0OLcgX8rz5 wMW8pFnz700BKGNCZo/RSGfeL2DEOlrdcfHBWR4w3801gCEcL1XA1nWD0dr4gqsgS4h2 9IGw== 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 i4-v6si22746569pfb.194.2018.11.02.11.28.21; Fri, 02 Nov 2018 11:28:36 -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 S1728322AbeKCDe0 (ORCPT + 99 others); Fri, 2 Nov 2018 23:34:26 -0400 Received: from mx2.suse.de ([195.135.220.15]:43674 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727465AbeKCDe0 (ORCPT ); Fri, 2 Nov 2018 23:34:26 -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 75E6FAD82; Fri, 2 Nov 2018 18:26:17 +0000 (UTC) Date: Fri, 2 Nov 2018 19:26:16 +0100 From: Michal Hocko To: Vovo Yang Cc: Dave Hansen , linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-mm@kvack.org, Chris Wilson , Joonas Lahtinen , Peter Zijlstra , Andrew Morton Subject: Re: [PATCH v3] mm, drm/i915: mark pinned shmemfs pages as unevictable Message-ID: <20181102182616.GJ28039@dhcp22.suse.cz> References: <20181031081945.207709-1-vovoy@chromium.org> <20181031142458.GP32673@dhcp22.suse.cz> <20181031164231.GQ32673@dhcp22.suse.cz> <20181101130910.GI23921@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Fri 02-11-18 20:35:11, Vovo Yang wrote: > On Thu, Nov 1, 2018 at 9:10 PM Michal Hocko wrote: > > OK, so that explain my question about the test case. Even though you > > generate a lot of page cache, the amount is still too small to trigger > > pagecache mostly reclaim and anon LRUs are scanned as well. > > > > Now to the difference with the previous version which simply set the > > UNEVICTABLE flag on mapping. Am I right assuming that pages are already > > at LRU at the time? Is there any reason the mapping cannot have the flag > > set before they are added to the LRU? > > I checked again. When I run gem_syslatency, it sets unevictable flag > first and then adds pages to LRU, so my explanation to the previous > test result is wrong. It should not be necessary to explicitly move > these pages to unevictable list for this test case. OK, that starts to make sense finally. > The performance > improvement of this patch on kbl might be due to not calling > shmem_unlock_mapping. Yes that one can get quite expensive. find_get_entries is really pointless here because you already do have your pages. Abstracting check_move_unevictable_pages into a pagevec api sounds like a reasonable compromise between the code duplication and relatively low-level api to export. > The perf result of a shmem lock test shows find_get_entries is the > most expensive part of shmem_unlock_mapping. > 85.32%--ksys_shmctl > shmctl_do_lock > --85.29%--shmem_unlock_mapping > |--45.98%--find_get_entries > | --10.16%--radix_tree_next_chunk > |--16.78%--check_move_unevictable_pages > |--16.07%--__pagevec_release > | --15.67%--release_pages > | --4.82%--free_unref_page_list > |--4.38%--pagevec_remove_exceptionals > --0.59%--_cond_resched -- Michal Hocko SUSE Labs