From patchwork Fri Mar 11 15:29:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charan Teja Kalla X-Patchwork-Id: 12778229 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 2A051C433F5 for ; Fri, 11 Mar 2022 15:31:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 68F5D8D0002; Fri, 11 Mar 2022 10:31:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 63DEF8D0001; Fri, 11 Mar 2022 10:31:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 507D28D0002; Fri, 11 Mar 2022 10:31:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0165.hostedemail.com [216.40.44.165]) by kanga.kvack.org (Postfix) with ESMTP id 439E98D0001 for ; Fri, 11 Mar 2022 10:31:05 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id EB959181A2570 for ; Fri, 11 Mar 2022 15:31:04 +0000 (UTC) X-FDA: 79232493648.22.CE4DE95 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by imf29.hostedemail.com (Postfix) with ESMTP id F04FE120021 for ; Fri, 11 Mar 2022 15:31:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1647012664; x=1678548664; h=from:to:cc:subject:date:message-id:mime-version; bh=PF6Eg9uUIzx22Jx9LT/iohqhCZ1p6IWaB9RmrqgpzxQ=; b=HaU31P0VeHUHS+NKdJWhvP4DqQDCwWqmcEk3SdrsGjoFq4P7RkYDUogL tlxXi2IMUS7zcwv+ZO9beWE7rVfQHpUf+qCbMs0serz+DMoZ/e6b1D89s graf/vFbN7QY4/yfN338oGaVx0LPvMCgYHxh7cTF6x+bKEyXGQhuYVGyZ Q=; Received: from unknown (HELO ironmsg03-sd.qualcomm.com) ([10.53.140.143]) by alexa-out-sd-01.qualcomm.com with ESMTP; 11 Mar 2022 07:31:02 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg03-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Mar 2022 07:31:01 -0800 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.15; Fri, 11 Mar 2022 07:31:00 -0800 Received: from hu-charante-hyd.qualcomm.com (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.15; Fri, 11 Mar 2022 07:30:56 -0800 From: Charan Teja Kalla To: , , , , , , , , CC: , , Charan Teja Kalla Subject: [PATCH V2,0/2]mm: madvise: return correct bytes processed with process_madvise Date: Fri, 11 Mar 2022 20:59:04 +0530 Message-ID: X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: F04FE120021 X-Rspam-User: Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcdkim header.b=HaU31P0V; spf=pass (imf29.hostedemail.com: domain of quic_charante@quicinc.com designates 199.106.114.38 as permitted sender) smtp.mailfrom=quic_charante@quicinc.com; dmarc=pass (policy=none) header.from=quicinc.com X-Stat-Signature: xwdrzws5ddtutbnr9135jfsga559w9uj X-HE-Tag: 1647012663-553181 X-Bogosity: Ham, tests=bogofilter, spamicity=0.034248, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: With the process_madvise(), always choose to return non zero processed bytes over an error. This can help the user to know on which VMA, passed in the 'struct iovec' vector list, is failed to advise thus can take the decission of retrying/skipping on that VMA. Changes in V2: -- Separated the fixes returning processed bytes in case of an error and ENOMEM handling of process_madvise() due to unmapped hole in the VMA, as per the Minchan comments. -- Improved the comment for ENOMEM handling case as per Amit comments. Changes in V1: -- Fixed the return value of process_madvise(). -- Fixed ENOMEM handling of process_madvise() from do_madvise() -- https://patchwork.kernel.org/project/linux-mm/patch/1646803679-11433-1-git-send-email-quic_charante@quicinc.com/ Charan Teja Kalla (2): mm: madvise: return correct bytes advised with process_madvise mm: madvise: skip unmapped vma holes passed to process_madvise mm/madvise.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)