Received: by 10.223.164.197 with SMTP id h5csp523348wrb; Sat, 4 Nov 2017 17:30:35 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QFqakbNjHFaksicvzB9QxvvShuZgypkGiLouIDfmLlRotIdufrJZ1HAbyz7xZ8ZgoLSfWB X-Received: by 10.99.2.23 with SMTP id 23mr2242708pgc.99.1509841834967; Sat, 04 Nov 2017 17:30:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509841834; cv=none; d=google.com; s=arc-20160816; b=lA+D/U2EhJePVIGN/P9M1Ly52Cog8wnTm94zuXYyR92svo2yKYMGsrcaw9Bx+8CSZA xcGi2FOK7EZeRNzaUTl9WZC3UIqjeN6uHOt0/6mIfL8ESxI4sM4arrRUMxlAWSRuvZnb KjFfY83ALoz8GnDOgyAH9vykaZX2woDFRN+tELPAHkJoRZ7sekgxzYeTvQwoZbMurP37 Af4L238v/rffXHOUhPVxaXy5xLmNIjidt+BqkRqOMpMqFl/hjt7f57TtH+YjKf6J3EM2 HHhyNidKCGlRv+KmEn+uJR1KQ6c8FkjImnxYZdENC+fidP4WBJZ0/kqV6+53snFLCm0E 62jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=NtZ3yCp5igyUERPaowIxRSpNYnKodtfjW2o8nOLP110=; b=NNBAuExUYPaPxuTlH+bOwxj0wc4E6lGeOwraPNXZVSjekvXq8gGqKOEFiJumSXfYPj GS8YhQaRWjgozvr4+adcWTtTwK06eRAY91jwdOGJzfLl5G3X6k/JoSwO2L+lNw+0XDbb 5yGTqYCI0mLXiDTm6jrH7llc6Hy5ajMGcvIKZ6UR3iMBB6i3QxXZIvNS9TlR9BlILfXX Qzkqy7+arsQsNVT8QsJE90dJBvVGKxFJAKMQpXFybaHLIY3fJppf/WH85/jCP7IiGWPl Qcvan5QfKDTh6Xm56HBMr6EUqqzbOMergh1bUnTEtX64ueevn8FjyOvi1fYGK4W6xPF2 52yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=AMNdGAjM; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 126si8769050pgd.518.2017.11.04.17.29.54; Sat, 04 Nov 2017 17:30:34 -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=@google.com header.s=20161025 header.b=AMNdGAjM; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752190AbdKEA22 (ORCPT + 94 others); Sat, 4 Nov 2017 20:28:28 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:55720 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751777AbdKEA21 (ORCPT ); Sat, 4 Nov 2017 20:28:27 -0400 Received: by mail-pf0-f196.google.com with SMTP id 17so4999273pfn.12 for ; Sat, 04 Nov 2017 17:28:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=NtZ3yCp5igyUERPaowIxRSpNYnKodtfjW2o8nOLP110=; b=AMNdGAjMh7I6H+NXJFHGrS5IZj1+/zR/BgK5uFJJcjXZPF8J+q5/yJi3Ki9c4AGVy7 x0rrm/dkFSm4B2dFnTg74lbDG4yz6yUfwE/I4bqBpTgkZkcco43R9oouA0K/mcBkj5Fk c1s+tIgb2gLQvV8dfSr4ss3Qt2Hl5JET16nUc3qszcPPsMnhKD42z34dZtrYyl+QoCPy WfxclqH1wnS6pmTRHw5TL1sdtzcxuPjbiFGqO+NO6Mk+PUtGWsQp0lDkAGc2V5Cwx8M+ Gs9oqDVAfk33Z505fSFn0i1+Ap+g2O0USuWHdeugUE9fqY+OVq58NtLldzxqS28lhwdM WAkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=NtZ3yCp5igyUERPaowIxRSpNYnKodtfjW2o8nOLP110=; b=kUT4sPw3ri2LSeOOXC0XVrqZsoCFmK/pFqYOP01htBLOKbxJl0/8onILk8MVqXjHIZ /XLciVhX8f19f3r57Njr3r9scoB5tTKM5Cg7DFBESal9WI7wePgRc5cKNI31eG2zxZNY cDIR+R0DU4AxVd2UMzFBLX9gcBLlWui2dCSLlHw8AstXNUZvIsA6pXV/8zuiNUwx+MPQ py3JqPVNNbJBz1b8FQOmRVPbsnbNv7nN9zWcb66WZ4S1U22ptLOkccjiCy7lG6mL1S+U XnaRZiD+7siCHgo0Mq4sAi16KlC2LVDxp4s5nrFAczChWxG/gtsJj0OdtkfMGrbXwleo J1Wg== X-Gm-Message-State: AMCzsaWVj1fSkfTANhUeZT+brcEL4WGGoUurcK6xoUW8PvM9OanODLPT gW4Vtm4M4qjr090zTEBjnep6DQ== X-Received: by 10.159.214.149 with SMTP id n21mr10978541plp.336.1509841706171; Sat, 04 Nov 2017 17:28:26 -0700 (PDT) Received: from [100.112.93.125] ([104.133.9.109]) by smtp.gmail.com with ESMTPSA id 62sm15732933pfw.129.2017.11.04.17.28.25 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 04 Nov 2017 17:28:25 -0700 (PDT) Date: Sat, 4 Nov 2017 17:28:05 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Michal Hocko cc: Hugh Dickins , linux-mm@kvack.org, Peter Zijlstra , Thomas Gleixner , Johannes Weiner , Mel Gorman , Tejun Heo , LKML , David Herrmann Subject: Re: [PATCH 1/2] shmem: drop lru_add_drain_all from shmem_wait_for_pins In-Reply-To: <20171103082417.7rwns74txzzoyzyv@dhcp22.suse.cz> Message-ID: References: <20171102093613.3616-1-mhocko@kernel.org> <20171102093613.3616-2-mhocko@kernel.org> <20171103082417.7rwns74txzzoyzyv@dhcp22.suse.cz> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 3 Nov 2017, Michal Hocko wrote: > On Fri 03-11-17 00:46:18, Hugh Dickins wrote: > > > > NAK. shmem_wait_for_pins() is waiting for temporary pins on the pages > > to go away, and using lru_add_drain_all() in the usual way, to lower > > the refcount of pages temporarily pinned in a pagevec somewhere. Page > > count is touched by draining pagevecs: I'm surprised to see you say > > that it isn't - or have pagevec page references been eliminated by > > a recent commit that I missed? > > I must be missing something here. __pagevec_lru_add_fn merely about > moving the page into the appropriate LRU list, pagevec_move_tail only > rotates, lru_deactivate_file_fn moves from active to inactive LRUs, > lru_lazyfree_fn moves from anon to file LRUs and activate_page_drain > just moves to the active list. None of those operations touch the page > count AFAICS. So I would agree that some pages might be pinned outside > of the LRU (lru_add_pvec) and thus unreclaimable but does this really > matter. Or what else I am missing? Line 213 of mm/swap.c? Where pagevec_lru_move_fn() calls release_pages() to release the extra references (which each page came in with when added). Think about it, the mayhem that would follow from a page being freed while on pagevec: of course it must hold a reference. The only surprise is that the extra reference is not needed while on LRU: one can think of PageLRU as an extension of the page count. Hugh From 1583038193978369921@xxx Fri Nov 03 09:54:27 +0000 2017 X-GM-THRID: 1582946571328910726 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread