Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp306126pxt; Wed, 4 Aug 2021 23:37:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQ70+1QlHadfJfp9pJ7Kn2IlcKPPoOPqq1c/m+2wZHVzx0zDoaziz2FRGrPPXDZpEY/oaP X-Received: by 2002:a92:194b:: with SMTP id e11mr2669719ilm.200.1628145453447; Wed, 04 Aug 2021 23:37:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628145453; cv=none; d=google.com; s=arc-20160816; b=vEzUSX0dAD/ZmR146ET3gE/Zjm9VWLYVXIGf1Y6Ijeb6hBjrh3RVuIQ+M2LTIdBCtH wqRgPJpbDnVrJ3OVpIuaAHoWTs/DWAT38/VwimuDLEx+EOPaloXzWJUJgY5M2fMtnBRQ IKhZ39bsQF4I39QdDD8kPBIPWizerOI4BGMFQ6fdzBEcDxLm3HzLNpXH2/MuO0AKYd2T uYfv/jgIBn/vP15+tpfwcm9yzVoCJlwKOXV/BP5X8ih1pYyk/j+Fbt4BF64npMj+yxmM E3LEkFriKTlJNufjudVng8BY9Iy4nLzZ7l1JKyUmWeWx+VTAAtsI+xcd5USTqVVZLgAn En6A== 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=Pq6KawdR8LnyUVocbXpZVi7zEmZn98UCA4pKU58eke8=; b=YyXcB7ZG71ebLd47WMi5oEIJRqYAGYobgM046zZVBpvwJmkqxOsfUPa1qp/6JnSBPx Hc2SloOjnSfo+ObozG+/fOlcOb/iymBWive0R9Kzyj+rxMcpz7J3TNb1rjHAWAY8Ue6E GQ5JhaRSpfhl/nFEoNpSz3MqRZRqDpkrKH0wPh0QMqGHgUv3sjC6I5eSvXAa54r/TPPF 0qnx0RVFKZuNr4tmB+EX7Hw12Y19fxmDS3fHFsN3Rfi+hw8zxkHTc+J9uGwpycYR+dN5 6EyBmdaQJXQJdJ0TyL66sTwbwKRXZd75tnlksyYSSqXZ3LoLXOkZSwpe9QXoerkv8+Ru fkBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=QgoLYjhD; 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 l4si6394234jaj.29.2021.08.04.23.37.21; Wed, 04 Aug 2021 23:37:33 -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=QgoLYjhD; 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 S238053AbhHECES (ORCPT + 99 others); Wed, 4 Aug 2021 22:04:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:52674 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231173AbhHECES (ORCPT ); Wed, 4 Aug 2021 22:04:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8A41C60F43; Thu, 5 Aug 2021 02:04:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1628129043; bh=Jg/kMvGL/SQF9WUw42I1K/ZAjAPxlF9udF1stSAMnCY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=QgoLYjhD8+ZU4OWWc3KoQGI8fuMPJxuSv3j1gUS76oyfV3aeF6YPnlVTymEl4xMky vI/VZ2FOdwl5veFgOoJVRWN6QQy6jityLJMbmw55wyN7XrZtL7k1X/Roe5vVplPPU3 SHSc3fTslltAT3I2fTioe89XkD0e+/Wt+hVkODPc= Date: Wed, 4 Aug 2021 19:04:02 -0700 From: Andrew Morton To: zhangkui Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-man@vger.kernel.org Subject: Re: [PATCH] mm/madvise: add MADV_WILLNEED to process_madvise() Message-Id: <20210804190402.8b9dbac3c4f417945c6d1de2@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. This will require a small update to the process_madvise(2) manpage. Can you please send a patch?