Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2068980imd; Fri, 2 Nov 2018 05:36:39 -0700 (PDT) X-Google-Smtp-Source: AJdET5c47K0TFaiCy18j9EVtDQK9VXmbNduGlamyc63ja9LgIQ52xCww788zLkgNIUe+bIs7EuLf X-Received: by 2002:a63:1c1b:: with SMTP id c27-v6mr10959371pgc.351.1541162199095; Fri, 02 Nov 2018 05:36:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541162199; cv=none; d=google.com; s=arc-20160816; b=fZOza1Juwt7OCUXLDn5yD1NzhwgBay/6Za6uS2GdfiQlPY8Vf5U9M8Sn3kld+kLVWg A39wmdBFSL8k6P37gPkUpoX4VfnL4PnX+XZh0FK9H3HhYr/EAjsvEOimgRTVuYkNqMnD HCsBBq4J4vn1dtTXtApR7Z3GWHO0uEn6GPRyfvrrodj2pRfKsrYDzlmnNm2ElIAY4KSK /qP+ar1RRLRm/yfy9e+6ddKAVnSqEelLrpMHeBNtVm6HZcDCbsTdse/bL7pY6BZ6wqQa aRbUbrZrCb9TqI8QLocX/azYWII0Df8ByjCXioUf8A/mI0Hmxj+2sXZfterR8FAl73L0 GFqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=YG3VChNFQS0CtyRt5u1f3UsENmETTfaopErDD3Ti+LM=; b=0bey6qcow65Ur+iRaWKG21bjSa9qpj0COplIzV2AXh7m//36RDhUFIhJjBJpw4Ozrv qoPWWOygR6HQfDXqztOpCRpKdjA+JbKi1mE7oz/O8XxVBpxOejhoK/EQ6bqyMtlmnFZb mmXaRpqP8wVcUrapYOE/xvyqLiOhT0GeLv/glZIUdm85NeAzNFs6Ims563Rh/8fvzWoj Q94bqIHEbhxtmLY6UhivIG0epp+nRFChygQpX8VTZH0r90hku90hmP8MK5cENxfaDHwP 91d7yHyg6zQsyS3Yk098Tci+cu+M1JKent2XELjqP9pqmw+hs7lssACOoezlLcgVzGSD HNGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Zez+yZcy; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 28-v6si12452902pgn.428.2018.11.02.05.36.24; Fri, 02 Nov 2018 05:36:39 -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; dkim=pass header.i=@chromium.org header.s=google header.b=Zez+yZcy; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727598AbeKBVm0 (ORCPT + 99 others); Fri, 2 Nov 2018 17:42:26 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:46886 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726265AbeKBVm0 (ORCPT ); Fri, 2 Nov 2018 17:42:26 -0400 Received: by mail-oi1-f195.google.com with SMTP id k64-v6so1410066oia.13 for ; Fri, 02 Nov 2018 05:35:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YG3VChNFQS0CtyRt5u1f3UsENmETTfaopErDD3Ti+LM=; b=Zez+yZcyjdTsYznjTiD1KQXSConV9IKL9qSvzK7x9KMKAs1kkhXP2DdQ2QZM6oTKko sZrN4EoP0ZZ11ZPvlCQQe+e/4Q1GwOJwb13k4IOlyKArPRTXIZiXKAiWux+0az8hq0mK cTNpGbTIoxHbtplOET2WVEh3y/F2FEE53d0OI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YG3VChNFQS0CtyRt5u1f3UsENmETTfaopErDD3Ti+LM=; b=KvYmHeRUoT1citEKdTnAfuX5piciFZUonWb7k8hnLCNf/AjDU7mVFeJWrrDCoODC7+ ruFQBMUGEMlAs3WCRwFZx6l1+jGekRvh+xDnQWGR6oK3dny0lO8HHtVA8o3vmYRpHtQh oCuDxWk/g9KuuAQywAiFSwjfvae2spk1m0zzOdf3OvvZzTCxfOxAF4qFlVWj/J0ee657 qxzkaeY4tnu1t58FDkhkU6KhUHjxcw/6zI3YoRN9ck2aImr1iiFvwBB9Nj8MDcperNKx 7ymf5TVI//Cq+Be+WUfZmfCG5cC9IN7XAsIMWPMDbTBxol0P9523B6t8trkoAgWbMh5o L8wg== X-Gm-Message-State: AGRZ1gLcdbPLf03EggEKkPF3oAX8Q4FdXGmp+pyVwPXvUHhRMcRaktVp Qu9vYp2EDmMszJU5LvsgMv2Et/355xqziC/7PLnN X-Received: by 2002:aca:f50b:: with SMTP id t11-v6mr6989387oih.57.1541162122995; Fri, 02 Nov 2018 05:35:22 -0700 (PDT) MIME-Version: 1.0 References: <20181031081945.207709-1-vovoy@chromium.org> <20181031142458.GP32673@dhcp22.suse.cz> <20181031164231.GQ32673@dhcp22.suse.cz> <20181101130910.GI23921@dhcp22.suse.cz> In-Reply-To: <20181101130910.GI23921@dhcp22.suse.cz> From: Vovo Yang Date: Fri, 2 Nov 2018 20:35:11 +0800 Message-ID: Subject: Re: [PATCH v3] mm, drm/i915: mark pinned shmemfs pages as unevictable To: mhocko@kernel.org 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. The performance improvement of this patch on kbl might be due to not calling shmem_unlock_mapping. 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