From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95249C001DF for ; Wed, 16 Aug 2023 07:11:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 08D468D0027; Wed, 16 Aug 2023 03:11:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 03D6D8D0026; Wed, 16 Aug 2023 03:11:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E48228D0027; Wed, 16 Aug 2023 03:11:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id D698D8D0026 for ; Wed, 16 Aug 2023 03:11:45 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id AF5151C8FCB for ; Wed, 16 Aug 2023 07:11:45 +0000 (UTC) X-FDA: 81129097770.12.F0937CB Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by imf07.hostedemail.com (Postfix) with ESMTP id DE9C540005 for ; Wed, 16 Aug 2023 07:11:42 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=Y4hEYzgW; spf=pass (imf07.hostedemail.com: domain of ying.huang@intel.com designates 192.55.52.93 as permitted sender) smtp.mailfrom=ying.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1692169903; a=rsa-sha256; cv=none; b=htObgVLlS833an5qRHayAa5X+OSYJHabuLqR9ejzbGH25cx5ZgHtqcEAN5VsZrYH0RKG7k ZH8z6Ns0TAq0Vz4nvGUco1EP2nkoc1bC5kQcbhLztKj1+zHigrKt5+hxvArlbKqfWnbitC rqRx/xmjCk2R2Uz1mzXs+Y3behdJIII= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=Y4hEYzgW; spf=pass (imf07.hostedemail.com: domain of ying.huang@intel.com designates 192.55.52.93 as permitted sender) smtp.mailfrom=ying.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1692169903; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=nFQ4eyGB+UyIdyWNhvvIPBVqiKiDfiIdpVnNjaSXWKg=; b=fEavZu+c6egMLavadMe/WtW5UxS4ko8kv4kFFk6WhclzJbJcMShd9X0Qhm4AoD5dfeMTeu pLKYqIiHBup33B3T+QQwrAlaShAx45iAdifKK5GAIgqRvJNiqk/4xxGUgq4KHxD90NkOjW k3hFOhJqJyLUuaVyunHPlBxoO02kpRg= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1692169903; x=1723705903; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version; bh=Fyuo5KVS7SmOX+46RsDtaSg2zfRHi3YLKR6KZxsGfz8=; b=Y4hEYzgWu5DvaOT8mhAp0wvqjLZCv6Ddv2kv8URy2FKT4VCObDGUHpL1 H2U50fWtXegVBeocaQRM4RE6PhiEZ+I6Em4awrf5atA30XMK7SO/Fk8SL mz2YCm6fGVvo/KDonmj1ksy2Df1goQHDo6TLwpj9gHSTUrVryBdlco9/v i2GSfTiLjngvfLUGXfJW8ruZDWNjsIraebupFdqr7qMDPl9xvgY6PSc8d UN+WbWLJrrpuwjyyC0VG/ACm1+JHjwkdwQoG8xS5KPITSCmdnN+jbih5t lL6Wqrs9tvdrxsyaFH2AGnmzoCC/v0BNAq2+U0AIml7GSvJDlhnOd6pm6 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10803"; a="369933756" X-IronPort-AV: E=Sophos;i="6.01,176,1684825200"; d="scan'208";a="369933756" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Aug 2023 00:10:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10803"; a="769084661" X-IronPort-AV: E=Sophos;i="6.01,176,1684825200"; d="scan'208";a="769084661" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.238.208.55]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Aug 2023 00:10:05 -0700 From: "Huang, Ying" To: Michal Hocko Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Christoph Lameter , Mel Gorman , Vlastimil Babka Subject: Re: [PATCH] mm: fix draining remote pageset References: <20230811090819.60845-1-ying.huang@intel.com> <87r0o6bcyw.fsf@yhuang6-desk2.ccr.corp.intel.com> Date: Wed, 16 Aug 2023 15:08:23 +0800 In-Reply-To: (Michal Hocko's message of "Wed, 16 Aug 2023 08:49:12 +0200") Message-ID: <87jztv79co.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: DE9C540005 X-Stat-Signature: cshxuyb7g7xcp3jnqt8jrghms3znpyn6 X-Rspam-User: X-HE-Tag: 1692169902-47845 X-HE-Meta: U2FsdGVkX194VtBnsrLOmFYxR73st93YOz+DtIL/7k3eAlczPArTvTHEBUqABBBj8yJWiMuBX8tZN09mR9sGJkNrRL/Mf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, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Michal Hocko writes: > On Mon 14-08-23 09:59:51, Huang, Ying wrote: >> Hi, Michal, >> >> Michal Hocko writes: >> >> > On Fri 11-08-23 17:08:19, Huang Ying wrote: >> >> If there is no memory allocation/freeing in the remote pageset after >> >> some time (3 seconds for now), the remote pageset will be drained to >> >> avoid memory wastage. >> >> >> >> But in the current implementation, vmstat updater worker may not be >> >> re-queued when we are waiting for the timeout (pcp->expire != 0) if >> >> there are no vmstat changes, for example, when CPU goes idle. >> > >> > Why is that a problem? >> >> The pages of the remote zone may be kept in the local per-CPU pageset >> for long time as long as there's no page allocation/freeing on the >> logical CPU. In addition to the logical CPU goes idle, this is also >> possible if the logical CPU is busy in the user space. > > But why is this a problem? Is the scale of the problem sufficient to > trigger out of memory situations or be otherwise harmful? This may trigger premature page reclaiming. The pages in the PCP of the remote zone would have been freed to satisfy the page allocation for the remote zone to avoid page reclaiming. It's highly possible that the local CPU just allocate/free from/to the remote zone temporarily. So, we should free PCP pages of the remote zone if there is no page allocation/freeing from/to the remote zone for 3 seconds. This will not trigger OOM, because all PCP will be drained if allocation failed after direct reclaiming. -- Best Regards, Huang, Ying