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 B216DC433F5 for ; Thu, 17 Mar 2022 16:28:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 370E88D0002; Thu, 17 Mar 2022 12:28:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 31F5B8D0001; Thu, 17 Mar 2022 12:28:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1E6DA8D0002; Thu, 17 Mar 2022 12:28:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id 1045B8D0001 for ; Thu, 17 Mar 2022 12:28:51 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id C2B9B20F20 for ; Thu, 17 Mar 2022 16:28:50 +0000 (UTC) X-FDA: 79254412020.04.6A890DD Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by imf14.hostedemail.com (Postfix) with ESMTP id 52A1E10000F for ; Thu, 17 Mar 2022 16:28:50 +0000 (UTC) Received: by mail-pj1-f54.google.com with SMTP id o6-20020a17090a9f8600b001c6562049d9so5937082pjp.3 for ; Thu, 17 Mar 2022 09:28:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=UWrsSvyUYUsX9uBJB0/kdPuxZQNwJ6igQetyk50XVfU=; b=LR9n/VsxM4TlrSligmfyVmMfTeFCv+a0295wYqgZlOBfLFyBQzhO7CddMgggmuz57/ vzht04DCXDlDxgOL5ub+6qnFOdClF/pRS3bv3/kM/nF/r/Q1xw00xkJjjo5/Tr0bnN8F unSwKZApVIScVuoBKlCRJPa7XLVARso2HXcuWp6/AfVCVRcXFiagXufY/bPFU0TM8jKp 6wLAk6MgNeXgl/e5KCVPHDNHrm7dYzJHfE0w/uUhtLgakB9DKvaPLEbOLcC8Jjmg0T4S lZU4uh/F6eYywz2x9QDvn+P8bVWYhvMjDbbJ3R1fG758wwpbHFZjgQmUkjYK18e64yjf Cg7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=UWrsSvyUYUsX9uBJB0/kdPuxZQNwJ6igQetyk50XVfU=; b=oLOwckaHBJhiJIW8iAuHTknd8Ojx2PKnzGWbhWbLGWzhoz4FdsFrXX+kAKu3uX3yWf YTUpq2D8xkNFGCmwW3IyqU0YwX+2AiH4GwFPbPXqKLpY6UzFy9mALCCjKiCKlehvps2I Beudke1PdHVIdCGLwfVbplhkrvGO/QYFhT7xNCttBYrqdhwP006wCgDNDkUrq990dbwf Qr6n912daMsWJgRG5FkzDGzXpGkoeJxMoS0I9+5q5qUjq2ObKBdi97xIK2+SwHq+hezO lza/1IgBcF1QsnDjthX82EFmM8T1IUWXBXMnzI/sxPZpnPvPD1vtmYRUiKOak0P+b5GD sAeQ== X-Gm-Message-State: AOAM533dn1EoksxdGF1Na6Sqo3wW8r5T+CSO2VDDamDItoeqqPJNjTaB NFV74q/iSRBuCPavGs/gRrM= X-Google-Smtp-Source: ABdhPJxcJJUi6ho81MBoVkLBUq3RjXNFlAsuvneVHylauwX6wr9lMcpmiz/arxhcPZQe8tF+hIWQug== X-Received: by 2002:a17:902:f70c:b0:14e:f1a4:d894 with SMTP id h12-20020a170902f70c00b0014ef1a4d894mr6026587plo.65.1647534529115; Thu, 17 Mar 2022 09:28:49 -0700 (PDT) Received: from google.com ([2620:15c:211:201:b625:fd41:4746:7bf5]) by smtp.gmail.com with ESMTPSA id t9-20020a056a0021c900b004f7b425211bsm6828279pfj.36.2022.03.17.09.28.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Mar 2022 09:28:48 -0700 (PDT) Date: Thu, 17 Mar 2022 09:28:46 -0700 From: Minchan Kim To: Andrew Morton Cc: Charan Teja Kalla , surenb@google.com, vbabka@suse.cz, rientjes@google.com, sfr@canb.auug.org.au, edgararriaga@google.com, nadav.amit@gmail.com, mhocko@suse.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "# 5 . 10+" Subject: Re: [PATCH V2,2/2] mm: madvise: skip unmapped vma holes passed to process_madvise Message-ID: References: <4f091776142f2ebf7b94018146de72318474e686.1647008754.git.quic_charante@quicinc.com> <20220315164807.7a9cf1694ee2db8709a8597c@linux-foundation.org> <5428f192-1537-fa03-8e9c-4a8322772546@quicinc.com> <20220316142906.e41e39d2315e35ef43f4aad6@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220316142906.e41e39d2315e35ef43f4aad6@linux-foundation.org> X-Rspam-User: Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="LR9n/Vsx"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=pass (imf14.hostedemail.com: domain of minchan.kim@gmail.com designates 209.85.216.54 as permitted sender) smtp.mailfrom=minchan.kim@gmail.com X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 52A1E10000F X-Stat-Signature: s4a5631c9fxh67pz7hchrib56xuh4tnp X-HE-Tag: 1647534530-978272 X-Bogosity: Ham, tests=bogofilter, spamicity=0.002217, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Mar 16, 2022 at 02:29:06PM -0700, Andrew Morton wrote: > On Wed, 16 Mar 2022 19:49:38 +0530 Charan Teja Kalla wrote: > > > > IMO, it's worth to note in man page. > > > > > > > Or the current patch for just ENOMEM is sufficient here and we just have > > to update the man page? > > I think the "On success, process_madvise() returns the number of bytes > advised" behaviour sounds useful. But madvise() doesn't do that. > > RETURN VALUE > On success, madvise() returns zero. On error, it returns -1 and errno > is set to indicate the error. > > So why is it desirable in the case of process_madvise()? Since process_madvise deal with multiple ranges and could fail at one of them in the middle or pocessing, people could decide where the call failed and then make a strategy whether they will abort at the point or continue to hint next addresses. Here, problem of the strategy is API doesn't return any error vaule if it has processed any bytes so they would have limitation to decide a policy. That's the limitation for every vector IO syscalls, unfortunately. > > > > And why was process_madvise() designed this way? Or was it > always simply an error in the manpage?