Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp928039pxp; Wed, 16 Mar 2022 21:37:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHD8Z8TQDL8rE5vn8Jn2txKmlrwRigm4mAa9/Sxzp51NA9eSawfzwR/Fq7/mzXuZzT35mf X-Received: by 2002:a17:90b:1642:b0:1bf:1dc5:965a with SMTP id il2-20020a17090b164200b001bf1dc5965amr3231586pjb.84.1647491830312; Wed, 16 Mar 2022 21:37:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647491830; cv=none; d=google.com; s=arc-20160816; b=FZhPPuhdALWFtjPwUV/dyXg8hjTULfTbE6AL7eeVAqz6dE5mQaDni3FqYZ/LYgyKWH B5uRo+ujU895j3zQ7qL8yxafNd/YVarb9bHmbhNgbrJRMpDxvV6yJGf+2KfZvfb4H7y+ ENHuXkwi2p0gWzFSki4ALM6YUU/catL1BwO60v3M/JY1E2I0qIsB7KbTBBg3lqbxptDs LQWJ/x/P7MYqEWWVbTg2oRUyG9onj5RTkvSLIiQRcnyOtt5RglQTdMmVimgoWs1nso4/ dcuinwnsVq6iRo90tU5grwY7Jt04nFAEGg7KeqzzswdDM19gyjykCe/a4nd2FhYX03Qn 0B4Q== 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=t7BlbYJweiFFxzAYEZyVO3z7vooFXjij1O8aghjxW/E=; b=xNN3fjpo9CYLrRYDhN1iyhP9RuvW7CrRoCMRAgrBeT51887zKhNgV3jTmATEamqoVe ek/6I6Q/ApMuvxhiH9HBCLD88nX9SVauvDCa+D4L1B2nvHevP1LwGJ0lR/lqRPeTyWYs Tvn1w9Y+5CrC35k0yYrj/p2hWDdDYqwxVDKFWqVn2j7xIbwMJPkwBSpg8+Hjv6telw27 sCQ+5Ss7fBrr6/WcffVtNtjzb+JtYarUjGnnoiCTjiYzbKwOVjrGe59LPb12lNxigNgt FYCiKgQLIK3zYwj+Bmw6hvgiUQVVFvo843eJghWHrxRPYaBsBH0Xe6ASCPHCmHfkqliX Gqrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=nyfrMxNi; 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 Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j23-20020a628017000000b004f6f0ad4207si3725657pfd.164.2022.03.16.21.37.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 21:37:10 -0700 (PDT) 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=@linux-foundation.org header.s=korg header.b=nyfrMxNi; 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6B508E59; Wed, 16 Mar 2022 21:03:00 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352626AbiCOXtc (ORCPT + 99 others); Tue, 15 Mar 2022 19:49:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352638AbiCOXt3 (ORCPT ); Tue, 15 Mar 2022 19:49:29 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 373A421807; Tue, 15 Mar 2022 16:48:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 8EFF6CE1D92; Tue, 15 Mar 2022 23:48:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4DA62C340F3; Tue, 15 Mar 2022 23:48:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1647388088; bh=lFbXIDa4QnBNJa5XI+6aSCuy5aLkXoZmkzSUjIS9Nus=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=nyfrMxNivbfRHfA/kgKORjOUDtNO0xiJdHK0Zph9F8/JEoL/jy+f1ikCofXmx6Ehf ZaG3CsR7684FTWNeIUJoRVTiz0it3ilSem5lDIkIYt5AkzCH2aaGRLkr7B+PbUWICp skiCnZTtAWjy0s3a6cMbZfgY7S3RC5np5wZ4DQgo= Date: Tue, 15 Mar 2022 16:48:07 -0700 From: Andrew Morton To: Minchan Kim 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: <20220315164807.7a9cf1694ee2db8709a8597c@linux-foundation.org> In-Reply-To: References: <4f091776142f2ebf7b94018146de72318474e686.1647008754.git.quic_charante@quicinc.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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,NICE_REPLY_A,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 On Tue, 15 Mar 2022 15:58:28 -0700 Minchan Kim wrote: > On Fri, Mar 11, 2022 at 08:59:06PM +0530, Charan Teja Kalla wrote: > > The process_madvise() system call is expected to skip holes in vma > > passed through 'struct iovec' vector list. But do_madvise, which > > process_madvise() calls for each vma, returns ENOMEM in case of unmapped > > holes, despite the VMA is processed. > > Thus process_madvise() should treat ENOMEM as expected and consider the > > VMA passed to as processed and continue processing other vma's in the > > vector list. Returning -ENOMEM to user, despite the VMA is processed, > > will be unable to figure out where to start the next madvise. > > Fixes: ecb8ac8b1f14("mm/madvise: introduce process_madvise() syscall: an external memory hinting API") > > Cc: # 5.10+ > > Hmm, not sure whether it's stable material since it changes semantic of > API. It would be better to change the semantic from 5.19 with man page > update to specify the change. It's a very desirable change and it makes the code match the manpage and it's cc:stable. I think we should just absorb any transitory damage which this causes people. I doubt if there will be much - if anyone was affected by this they would have already told us that it's broken?