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 X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21378C4338F for ; Fri, 23 Jul 2021 06:20:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0132260EB6 for ; Fri, 23 Jul 2021 06:20:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234099AbhGWFjy (ORCPT ); Fri, 23 Jul 2021 01:39:54 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:47628 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234047AbhGWFjt (ORCPT ); Fri, 23 Jul 2021 01:39:49 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 5D0521FF53; Fri, 23 Jul 2021 06:20:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1627021220; 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=v8uQ4/E3Pg2AaedWhgz8TbxdBCTE3NVNf26n2c3ARfE=; b=Fitv+2rBlAONt3Ul0ivrD3yXXmi9oKL+oO7Ox7WlnJ2NUNdmDc1v77oKiYkcu9cD7/+soA XTDUsHdv00QaXiHZMYR6/OBlrF1TDLJIdzHP9CIOn1gfKTaCTMj2cnqcLfYUzG1pnCkTe9 2lkTTuRTtzv8CgTPlhOL9EI2R6g3AuU= Received: from suse.cz (tiehlicka.dhcp.prg.suse.com [10.156.228.52]) (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 12EDBA3B87; Fri, 23 Jul 2021 06:20:20 +0000 (UTC) Date: Fri, 23 Jul 2021 08:20:19 +0200 From: Michal Hocko To: Suren Baghdasaryan Cc: Shakeel Butt , Andrew Morton , David Rientjes , Matthew Wilcox , Johannes Weiner , Roman Gushchin , Rik van Riel , Minchan Kim , Christian Brauner , Christoph Hellwig , Oleg Nesterov , David Hildenbrand , Jann Horn , Andy Lutomirski , Christian Brauner , Florian Weimer , Jan Engelhardt , Tim Murray , Linux API , Linux MM , LKML , kernel-team Subject: Re: [PATCH v3 1/2] mm: introduce process_mrelease system call Message-ID: References: <20210723011436.60960-1-surenb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 22-07-21 21:47:56, Suren Baghdasaryan wrote: > On Thu, Jul 22, 2021, 7:04 PM Shakeel Butt wrote: > > > On Thu, Jul 22, 2021 at 6:14 PM Suren Baghdasaryan > > wrote: > > > > > [...] > > > + > > > + mmap_read_lock(mm); > > > > How about mmap_read_trylock(mm) and return -EAGAIN on failure? > > > > That sounds like a good idea. Thanks! I'll add that in the next respin. Why is that a good idea? Can you do anything meaningful about the failure other than immediately retry the syscall and hope for the best? -- Michal Hocko SUSE Labs