From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 15BDF1378 for ; Wed, 23 Mar 2022 08:28:45 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id DE5C3210E9; Wed, 23 Mar 2022 08:28:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1648024117; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=CW3R+Yiroys6he2hHa/SHBZUim+4itSeZjujNKPJOmQ=; b=tB448LMyefBx5twawDjt8knurabMyegikQW37yhYusJrNOEXKgv24DS1/jaejnVIzzL2kC TRwSrtJYxTnLlLapwzTrdxKmv0M0c2o7gdzOXvw4NQNzFLUKjENKzApLxv6UR+TN3zYYdM lWYYH57ssNh0s5XojNY4nxboJ1uCwzw= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 8E09FA3BA1; Wed, 23 Mar 2022 08:28:37 +0000 (UTC) Date: Wed, 23 Mar 2022 09:28:37 +0100 From: Michal Hocko To: linux-kernel@vger.kernel.org Cc: Andrew Morton , vbabka@suse.cz, surenb@google.com, stable@vger.kernel.org, sfr@canb.auug.org.au, rientjes@google.com, nadav.amit@gmail.com, quic_charante@quicinc.com, patches@lists.linux.dev, linux-mm@kvack.org, mm-commits@vger.kernel.org, torvalds@linux-foundation.org Subject: Re: [patch 163/227] mm: madvise: skip unmapped vma holes passed to process_madvise Message-ID: References: <20220322143803.04a5e59a07e48284f196a2f9@linux-foundation.org> <20220322214648.AB7A1C340EC@smtp.kernel.org> Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue 22-03-22 17:24:58, Minchan Kim wrote: > On Tue, Mar 22, 2022 at 02:46:48PM -0700, Andrew Morton wrote: > > From: Charan Teja Kalla > > Subject: mm: madvise: skip unmapped vma holes passed to process_madvise > > > > 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. > > > > Link: https://lkml.kernel.org/r/4f091776142f2ebf7b94018146de72318474e686.1647008754.git.quic_charante@quicinc.com > > I thought it was still under discussion and Charan will post next > version along with previous patch > "mm: madvise: return correct bytes advised with process_madvise" > > https://lore.kernel.org/linux-mm/7207b2f5-6b3e-aea4-aa1b-9c6d849abe34@quicinc.com/ Yes, I am not even sure the new semantic is sensible[1]. We should discuss that and see all the consequences. Changing the semantic of an existing syscall is always tricky going back and forth is even worse. -- Michal Hocko SUSE Labs