Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp797290pxp; Fri, 11 Mar 2022 15:24:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJypCTpIKuIDfHdu1HdynNjskMR/Dlgx0qbNhoaLO6Sx6VrcqkV6SAKqf2/ditQcAMmfrLX7 X-Received: by 2002:a63:89c6:0:b0:37d:7ff8:6c0 with SMTP id v189-20020a6389c6000000b0037d7ff806c0mr10181957pgd.196.1647041058380; Fri, 11 Mar 2022 15:24:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647041058; cv=none; d=google.com; s=arc-20160816; b=bEHfDFaVNk+a8p+mu1GTT+K2KtIup9dV9mHoUiP8WWeJnOpld0Quaqc+fHt+Rf8AJb tYkMROCYlilbcu/3ana/PZ76wK7gtvVCCToaPcrzXwXuH2h4e3moU5+IpYeca9qrRVj0 5+d/kSFm2MHfklepbGEEcVWEpFLL4n5g21xF2oYi7RWRgbKrAaecOi9tWr5KwmOrHtSJ Pt48ap9H3xiGBqCuqXNcfnBasIytNUFG9eQqENN89kGFb61BtUw5GyNgY8X422yYqmR5 kTPu4mz9lVmQVEMbBK3kjWaVznf7MKlGvp4mvI/ri18bC5NLg4gay3mugbkEWI4OyEuT UGTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=PF6Eg9uUIzx22Jx9LT/iohqhCZ1p6IWaB9RmrqgpzxQ=; b=COYToOJn46EI8X4D+TR4Jgw/+eTokxfSTBcsDRAVxtnmun9XNZluplak7uFO+Om9gi Rl9Pl5F4sOHpqy0JwikHOX0jdkvWK8b1UPmKOQT0Y7DZRP5l9K+RfqOv53HB8vrRiTkl C9AnVDcTtaxMHBmkXSMsmY8TxnQmzi26pdiRL1D9FD6icJSsl6tqQSFyeR5sopf//Jgq AdPIvKDbPW7CY6LgKEE4dhutstb4+2PzRF8LlaRETaUjPaX4toyNFaPVM5UrOnTV49rs hF0VBV8BZ4QXsDzM7ngeeqLc3W9Qn8CIhWjRjb05sXYHzwUjprjf3yJODKL0bOSmqKUC rCIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=wqcwFTGZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id fs19-20020a17090af29300b001bd14e0303dsi6142139pjb.21.2022.03.11.15.24.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 15:24:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=wqcwFTGZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 96EA123456E; Fri, 11 Mar 2022 14:10:41 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349233AbiCKPcI (ORCPT + 99 others); Fri, 11 Mar 2022 10:32:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235632AbiCKPcG (ORCPT ); Fri, 11 Mar 2022 10:32:06 -0500 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EE5D1B8CB5 for ; Fri, 11 Mar 2022 07:31:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1647012663; x=1678548663; h=from:to:cc:subject:date:message-id:mime-version; bh=PF6Eg9uUIzx22Jx9LT/iohqhCZ1p6IWaB9RmrqgpzxQ=; b=wqcwFTGZNDsrt9hLHRavxiZ+alxGveEAoC9pgfEOX8a05qfdIXdRU4/9 ZGUi+2A7xWIocpKoM7cB0YBFju1CLXPhDHtWU8QkY9wQ2DF2pCmn7Lnbn f/SKv3PodQMRtnwRB4u9JmLm0cpqrdjSurS0XtEEb18JOSziNKTgLdjLt k=; Received: from unknown (HELO ironmsg03-sd.qualcomm.com) ([10.53.140.143]) by alexa-out-sd-02.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 Content-Type: text/plain 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-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.7.4