Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp349943pxb; Wed, 14 Apr 2021 17:30:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjw+T0CwdfDc2gHt9l14MpSiWhFVDeXBMX+Uo+3UpMqO0RB6KjHZq5gpBGYW6Ehnu39EyL X-Received: by 2002:a17:90b:714:: with SMTP id s20mr831723pjz.62.1618446608755; Wed, 14 Apr 2021 17:30:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618446608; cv=none; d=google.com; s=arc-20160816; b=VMQ2HLe3wMX6ijtdqoy9psiJ0VHQ6wlUoqESkgFoKM38XLHKBSTsn81dKUcwXrHwvy pJKJWfszLH6CePLEwP11pOL5yTmdsj7Y5Ra0eg7QLzwoUuLK0aOtEKxInzb3c51zIplG bPa3g7I3oyFB+3OlnV4vk0ZnpH4Nc7diy5PlBXzYdATnNo+iA6bGb9vaJiAsLGbyskyl gYV2zWkYD5VizEOs9drvwpABLBJMw9+4o8JDTc6lQB/OPMCqNMatXl8epdoSd2pR4gFG 0aTbPQgEsYvGaWbiFxH37hdyV62HwegMVn0WBTbZKgkUVRHqVzLcq1ZOIFl2jkcjOc3l m8eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=0Sv9NEP22wjna5CIpFfxEXT3qRzPSodaVUOesDxk1QA=; b=ckuVR7o4k6ZMRREzDnYYYDweq+0PoSkzFlqEjyyXWqUjB/khzWK04cnodNe4xi91iU oPOkAega16CFZlAFACl1ax8ewgVPdMf7yQeGRd27wUs8SkqgDqd+qx27dZxL+crfDHEF P0jWyV/5V7u77ixbmoaIqzGBH8TsE8lCp+6oPTX+tJZ4D9XcV/IY4dr3R1K86j0AT84p lYEkQLeYGsgs4sFlLKlnIDFHAj6c0BOKQmqfVIAyg4s87HxAslDdaCzLTqIFQ9MP6MCA Qq9WMcXUOLVOje/HHUQdMn9D21l7Nssuyu17Oene0V3b7mcZmh6KqAn2oOkxtCtMl6gZ iYNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=VLkGN1vJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 1si1073010pfy.340.2021.04.14.17.29.56; Wed, 14 Apr 2021 17:30:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=VLkGN1vJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233688AbhDNOj1 (ORCPT + 99 others); Wed, 14 Apr 2021 10:39:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231678AbhDNOjZ (ORCPT ); Wed, 14 Apr 2021 10:39:25 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36ED2C061574 for ; Wed, 14 Apr 2021 07:39:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=0Sv9NEP22wjna5CIpFfxEXT3qRzPSodaVUOesDxk1QA=; b=VLkGN1vJjSHuydMty0NSFfPDnq avZRQ4ysQU5wSO8a8yVkJqe6H5ZsDqXUGlxnLpeH+8sLO8LBS7sdU6I64XNB8GUnn0HH3aJIQxZMd LvjncF+hpEmIgxElClojr6YNbkmIhgzlyUfUQ02+eOnW5G0zWLrFmmYms3I/yfVF4YsNJa8ZWcsu1 m7xA6Sq8ZeNzmQUxfYZexyEceaK9rqjr1VWRzYgfZxcv51N8LnLrWqP+HOSf+4VvxTdjwpj5ePMOw kXrXk6zE9M0TqHymq07CJGeaCU67MmcmQjpIvbSKFpr2C4KzHpGfh3rlYrKKnPXr8lfs1E1Odbm8b YKFKDqLA==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lWgd0-007EGl-DK; Wed, 14 Apr 2021 14:36:29 +0000 Date: Wed, 14 Apr 2021 15:36:26 +0100 From: Matthew Wilcox To: Yu Zhao Cc: linux-mm@kvack.org, Alex Shi , Andi Kleen , Andrew Morton , Benjamin Manes , Dave Chinner , Dave Hansen , Hillf Danton , Jens Axboe , Johannes Weiner , Jonathan Corbet , Joonsoo Kim , Mel Gorman , Miaohe Lin , Michael Larabel , Michal Hocko , Michel Lespinasse , Rik van Riel , Roman Gushchin , Rong Chen , SeongJae Park , Tim Chen , Vlastimil Babka , Yang Shi , Ying Huang , Zi Yan , linux-kernel@vger.kernel.org, lkp@lists.01.org, page-reclaim@google.com Subject: Re: [PATCH v2 10/16] mm: multigenerational lru: mm_struct list Message-ID: <20210414143626.GT2531743@casper.infradead.org> References: <20210413065633.2782273-1-yuzhao@google.com> <20210413065633.2782273-11-yuzhao@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210413065633.2782273-11-yuzhao@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 13, 2021 at 12:56:27AM -0600, Yu Zhao wrote: > In order to scan page tables, we add an infrastructure to maintain > either a system-wide mm_struct list or per-memcg mm_struct lists. > Multiple threads can concurrently work on the same mm_struct list, and > each of them will be given a different mm_struct. > > This infrastructure also tracks whether an mm_struct is being used on > any CPUs or has been used since the last time a worker looked at it. > In other words, workers will not be given an mm_struct that belongs to > a process that has been sleeping. This seems like a great use for an allocating XArray. You can use a search mark to indicate whether it's been used since the last time a worker looked at it.