Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp306099pxt; Wed, 4 Aug 2021 23:37:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjpf+Gn+hyb+oO8F/Xg6guVxXGCz2c1lT3bUOAeN8QGyMG12K2ZiNCxNwI2pbnJp0IfY8z X-Received: by 2002:a05:6e02:1aae:: with SMTP id l14mr573137ilv.35.1628145451410; Wed, 04 Aug 2021 23:37:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628145451; cv=none; d=google.com; s=arc-20160816; b=dhXpuJmiVRyFUEq9Xgxv0rpRx6OFeAWECvcBLUpiUN2FDX/GKOv268DMUo+mk1bffK +/ncHcvyI00n+fMxibjniWtUL3IEknJf67G+p3GLvs0T8hFZfZM9hs6Xy50V0ggkX1Fm ubBfCAETbS5765mFTNq3sMmdo61Av2abOPY1EEh46t6aKaSc5J0w2CyXqDoSdND0zxPI 56f08fSyV+jJOtGYofShlu5WUYYRgx687DdhQYXP/diJs/OfmjYWU8DcYyHSfhTE2v52 h2t8TfSZq3qrcrnk8q2a2VvFKe/A+8biB7SKBpUOOuLlKwv+ge97HKQBDgW1b3UHC36A hlTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=y0Aba39ELO98g/iPVH4IMNhsAGza4adF1HyMJNngKa8=; b=VjDrTxshAjEmpRJV6JOrHPaKQsy27RTDcOFYq4CyIXZ/JqesM+13XTYiXXpHj6pYnL Z/ROEeOGMRHU0/sszk66+hnRPpvNHwcq/aVefcjcqG5r87sLS7Nu6NfzuHjzgtgF1BYl sajw+fRQx+chqdwrldWtu6xo1DW7kEUoFOQDfLBNYE7K4H7gCoEIgvf5AcwKvmwk+cdH GbkbIa2b5Ge14Jt/Dwtt8AvY1l54SX7CfU/r1A1KMDuRmGucev/Vye4IBH3LjPZbLBV6 SeGILe94IffWj/3q+hQaTKsTc4ci9mZadSZ+tSUqZNM3G4HQhb/2Ocgliax2IV10nCTv oKGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=dgpQMURw; 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 g15si4875929jan.75.2021.08.04.23.37.16; Wed, 04 Aug 2021 23:37:31 -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=@linux-foundation.org header.s=korg header.b=dgpQMURw; 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 S237748AbhHECBL (ORCPT + 99 others); Wed, 4 Aug 2021 22:01:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:49378 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237415AbhHECBK (ORCPT ); Wed, 4 Aug 2021 22:01:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 75BFD60724; Thu, 5 Aug 2021 02:00:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1628128856; bh=0/LJbZOSET6Tm34ypJIUrrO1FVVoPHDm0WYxiO39aBA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dgpQMURwEX3dUeoc12vUI+KlxNt3URNlDgz6YG2QxsjxiFlSJRO0/6t1pnCaPR5FS KqNQU/FslgxN5cUiD5guGwV+V64x4lNMgXNGJHxBXNB84h2Ydbxvaz/nsKl9nIc+TX 1M5ISNDyWfQ38jLqdu2leOp3GmEDO+Fwz8BOx/kM= Date: Wed, 4 Aug 2021 19:00:55 -0700 From: Andrew Morton To: zhangkui Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/madvise: add MADV_WILLNEED to process_madvise() Message-Id: <20210804190055.b484ab15587cc891683eafea@linux-foundation.org> In-Reply-To: <20210804082010.12482-1-zhangkui@oppo.com> References: <20210804082010.12482-1-zhangkui@oppo.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 4 Aug 2021 16:20:10 +0800 zhangkui wrote: > There is a usecase in Android that an app process's memory is swapped out > by process_madvise() with MADV_PAGEOUT, such as the memory is swapped to > zram or a backing device. When the process is scheduled to running, like > switch to foreground, multiple page faults may cause the app dropped > frames. > To reduce the problem, SMS can read-ahead memory of the process immediately > when the app switches to forground. > Calling process_madvise() with MADV_WILLNEED can meet this need. > What is SMS?