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 AA968C77B71 for ; Fri, 14 Apr 2023 19:10:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4D2C06B0078; Fri, 14 Apr 2023 15:10:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4836B6B007B; Fri, 14 Apr 2023 15:10:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 34B7F900003; Fri, 14 Apr 2023 15:10:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 257E66B0078 for ; Fri, 14 Apr 2023 15:10:40 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id D7C61A03C3 for ; Fri, 14 Apr 2023 19:10:39 +0000 (UTC) X-FDA: 80680938198.04.947A3DA Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by imf03.hostedemail.com (Postfix) with ESMTP id 955F22001F for ; Fri, 14 Apr 2023 19:10:37 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b="aoRu/tV/"; spf=pass (imf03.hostedemail.com: domain of quic_charante@quicinc.com designates 205.220.180.131 as permitted sender) smtp.mailfrom=quic_charante@quicinc.com; dmarc=pass (policy=none) header.from=quicinc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681499437; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=UNe3B2DRPlpiQBM7MT6ze0rZg1VfylbK5urVwiDLjD8=; b=WgO1i74/i+RYCoVFcnb5/NOgWJ7IvrIX7MYwh3isR3yJPvr+nmvXFNM87zAr4v8fyEE7+j dKShvSVSxJh1lWC7CGMRvcuHUA2SNMuK4LHm6lJDxgPpddONGQt+GKneQo8IAStf87EI2c WvGRe7WbdxcGg8n8TUVax8s6ySpNMJs= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b="aoRu/tV/"; spf=pass (imf03.hostedemail.com: domain of quic_charante@quicinc.com designates 205.220.180.131 as permitted sender) smtp.mailfrom=quic_charante@quicinc.com; dmarc=pass (policy=none) header.from=quicinc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681499437; a=rsa-sha256; cv=none; b=k+/xN6CUyJ73iIGxOxPEH3vNqOqOMAzVTP5VSniBUH9uB1ozrWVGftQ9mC1VBmBGCyjb/f 8T3LeQSmE0yYce7tyDwgFTSIqCvdkS6Vg6hPBGmXiX6XAxTAepGgsX3joLRJVaiSNpG/Ej 7rRxYVmX2p0TnnqtFgA/z/q8PwgCteo= Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33EJ1qBC005954; Fri, 14 Apr 2023 19:10:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=UNe3B2DRPlpiQBM7MT6ze0rZg1VfylbK5urVwiDLjD8=; b=aoRu/tV/oeYPLz1E2HUeZVZfF2iRv2LN+pDbjrxOb9hl1pIp5+nPwtYSKAtMW56TuvFE p2XHhz8oiwLB35qgFtWs9ZnIf9tMVTQZeT/AZv5JZu24oUGttZVCKKVitWhmPrZD7DxE xyNOxR6nXzCllIvy5mh0mK0W6n+pm4kOspl0Ew8uk8RM++KgIkInFaI3bsLBNv460n+9 /98cpJLDCemqqQKyva1DFMriJ9V/UkoHHT/lBU/PgeSo7jtid+TGW68y0sE5Rb8VYeic Oz4j7zeUh7Awg5UaeBgESsil42SThAT5OPQnouJX3BpVYu+k5iFIBSIf9EM8xqqmp1PF 9A== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3py1kx1hs2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Apr 2023 19:10:28 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 33EJAQTZ031515 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Apr 2023 19:10:26 GMT Received: from [10.216.16.3] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Fri, 14 Apr 2023 12:10:22 -0700 Message-ID: <0853b4b0-770f-f742-95bc-eb74a1859138@quicinc.com> Date: Sat, 15 Apr 2023 00:40:17 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH V7 0/2] mm: shmem: support POSIX_FADV_[WILL|DONT]NEED for shmem files Content-Language: en-US To: Frank van der Linden CC: , , , , , , , , , References: From: Charan Teja Kalla In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: 6irWvQUSKZKeJgaEOgnacy9j4a8avZEw X-Proofpoint-GUID: 6irWvQUSKZKeJgaEOgnacy9j4a8avZEw X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-14_11,2023-04-14_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 adultscore=0 phishscore=0 clxscore=1011 impostorscore=0 mlxlogscore=506 spamscore=0 suspectscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304140169 X-Stat-Signature: b8adcwaqnbem1zpuzdohkathdgudkknx X-Rspam-User: X-Rspamd-Queue-Id: 955F22001F X-Rspamd-Server: rspam06 X-HE-Tag: 1681499437-158084 X-HE-Meta: U2FsdGVkX19/mRXUR5OCPcu/Dd/JzkgEyM8kqaHTciMH3/avjbK+8GnEadFjs6WoSzNkXJE1kOu4vu7CjcDfu3+H3DGrrz09fYq10EW/M1eSlsfr6oscrT6vdgyHt/3wZFEX3tbWqCopXmChMrYIhlbuRuVxPUllHoWpbBw7rdcxMVnyAOm1kQmggXrTjaajp/l3DToth7PKlMrKFEhjaCPsGJyodWC95OvwBvAiB+IHARQkNV6fs18w6Wy2q5ZtJXTzBm4903wcO9+h49AANv2hNwEDyZMzMomEV1OVF67VYyQhb291ULuSVHCWQoeCzudqBrl2lkwoPgvGdv2R594ppo5DaCL6AODqpAB5ZLDlp1Z6N/NvqKckrdCukUs3VtQ/TxnV3P+tHFKZ9p2lyoCRR7wx8C60wqW/X2tH3fQRoP8oIWiq0v5A+cTPUuluvZspPP7slrgm68SbZqaQN1XXmB9okSP2PDDmNLBntjTCUwSHHmpsBMvID6WlODHvXXZN/gCk6tAGWgG0NmEg1cRrR8XZI7lgX16lfT4MfVJCxAnUJjAYTrAkKMTgshgSGApNehQQzTELU54mYFEOq+UY+JapsOR1gbo2QjDPSGLz8jKMoy0H3zLk3LRaYoGLLe93nM0S1zMwhiPh8tNRhNSI9DW2GEeoh3A6sYOA1FIWVPfCaaZ38K75JT7NwMZhzCJfMpzJhSEqAJmPenDEtsBDXwTUHLIzzbSyCAb/WNYQbIAJqqkuzXcWB7lL1jKYXThtXpNBK8C2r/+iVRZVHebgi9adkj/IxKX559GjvhgmJOgvm+/uitcX3Hck/lRiPKmoj50HKMgR/lgh83dh/PsCiN458+fU58WcFL/ct/hGLwqPdLiuMvcJyDEiexGN3ftx9PJ38JuYG/RmXKNKKnv3X1QjhN67ZkoorOLMYZ0remthf5btYGkJHG8QjBeiNI+0KF8TpK72sOrx3ur 0TdcU7wu JgDhbvVmfPU0UkNXhDbL3xbWTfhiAS3rAL/YzFDG9bn1CS6vfXYI2D5I8qetTpAx5Dd2EeIsyOCbdknQ6vt6mA9RcBpO6pW5sb9ygNKRZ2dO6rsKzPo6V9j7K6pzkqa1LQn78XAlkBUupdnlXBvIWf0VrpFbNRsel11c3WWIcDwRm7mdoBY2d5afNL/SoyU2lQLG0OJ0G5/eEBuWDhkEsICTDdl1RSIz42vhU9UrP6azw9l0y9AuzMHhKZwiETmP+RFmp7ILMLecPejI= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000005, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Thanks Frank!! On 4/14/2023 11:14 PM, Frank van der Linden wrote: >> I didn't see this patch before, so I looked a bit at the history. At >> some point, in v3, dealing with mapped pages for DONTNEED was left >> out, they are now skipped. Unfortunately, that makes this patch no >> longer usable for a case that we have: restoring the (approximate) >> swap state of a tmpfs file. This involves walking a potentially large >> number of regions, and explicitly pushing them out to swap. This can >> be used to e.g. restore the state VM memory that is backed by a tmpfs >> file, avoiding memory usage by cold VM pages after resume. >> This is an interesting use case and I feel this really supports this patchset. IIUC, supporting the reclaim of mapped file pages through fadvise() helps this usecase where you can avoid traversing the large number of vma regions as you can directly issue the fadvise() on the shmem file 'fd' and it takes care. Am I correct? > Hmm, actually, looking at it a bit more, there are several issues > here. One is that with fadvise, you can't be sure if you are the only > one dealing with the page in a mapped way(with madvise, if mapcount == > 1, that mean's it's just you, but you don't know that for fadvise, so > that makes correctly dealing with mapped pages harder). > Sorry, Why not for fadvise()? I can still attempt only if the page is mapped and its mapcount == 1, but then we already have madvise() for such pages and why not we simply use it. > Also, the madvise loop issue can probably also be dealt with via io_uring. > > So, I think we can deal with the use case I mentioned in a different > way, that is mostly unrelated to this patchset, so basically: > disregard my previous email. Sure! If this patch looks good for you, Reviewed/Ack tags can help me.. Thanks, Charan