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=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL 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 B79A1C432BE for ; Fri, 23 Jul 2021 08:19:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9E4A860E8E for ; Fri, 23 Jul 2021 08:19:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234411AbhGWHig (ORCPT ); Fri, 23 Jul 2021 03:38:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234329AbhGWHie (ORCPT ); Fri, 23 Jul 2021 03:38:34 -0400 Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com [IPv6:2607:f8b0:4864:20::b36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57798C061757 for ; Fri, 23 Jul 2021 01:19:08 -0700 (PDT) Received: by mail-yb1-xb36.google.com with SMTP id x192so1201956ybe.0 for ; Fri, 23 Jul 2021 01:19:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fq4Fh4QeM8XI+vyUIqPOIRXCTIfB49cqBPc4/QtIH+U=; b=dloDLGg4fXJdm4/Wrm6ZB7K2+ON08uA2iW/97Bm40pzw8M0/y7TC+Ng9UT76mHJTHv C0ppKytkc/8u6eXp5NPtf8qz9fLJ4PnCfsAlWmJSEwVuOXPPfc5JrsZSiewGVn1O+j3E +9CIZ9AStO6ZN1E5axBcLR360dWP15ECEtw0YcmpOOL57pJfwMUbMbM5sfgYMo73zZKa 87v3CqCZm5KRP1BTwwU3aiDizqsM5qdcfblypkxCZaLvV8Lj+mnOWHFF7CKGSREHryH1 Oz5fmSrrkfNlopqiP/MEcHyTC28TQklU/D095rjZB28dYTRbOLA7Um0ywW2b0/uR6bl9 Y5tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fq4Fh4QeM8XI+vyUIqPOIRXCTIfB49cqBPc4/QtIH+U=; b=rVA84RFIRg8OBMekh4Q98XIxjCGhGdO/oz14D4XWIKn3vKpUc4TrtgNQ37JYDRZtvb DrgO1+5t/CsMDKx+Bo26JAJSxegJTdaRmY/++AYmIGHSjgAGtXypK2Ex/nqePchR489k jggVEnhPHtrzBf8lc9/6dUpiOX2u/ODWK1LCClUK+N/isPQV2aXPGpdOWYkv569vRsZY BsBPbU1uhffDBwE3bwTtDPRfbMPKNx123fe7Ezhsbpbto9CdW3MPxbjqo0Aacb1yCZ59 sn69pS7UFNakKx1Bi/3ZmL+FRD/t28CkbJn9dCHvoiWxLhFpZoLzfrr3ki6lClcu1FzO 5KUA== X-Gm-Message-State: AOAM532Nb1LRqr4/1U7nQQw6NkGL+oZ1E62ZnAQ5XjcupB0Un6Beb2Yk BKXOBfgst61fnfl0pTzUjrzEDxbj72icdaJ6RYEwXw== X-Google-Smtp-Source: ABdhPJwgDfc0aM41zUz0in82Zs/wTUFLmp89jRt6vYbZp2U5yjFxAH0SP/iwlkBSF3REEbD+9yUtJDVjnWKmWsf9TDk= X-Received: by 2002:a25:7ec4:: with SMTP id z187mr5079566ybc.136.1627028347391; Fri, 23 Jul 2021 01:19:07 -0700 (PDT) MIME-Version: 1.0 References: <20210723011436.60960-1-surenb@google.com> <23ed1d8d-fe55-fdbc-ca33-01a3ce392dff@redhat.com> In-Reply-To: <23ed1d8d-fe55-fdbc-ca33-01a3ce392dff@redhat.com> From: Suren Baghdasaryan Date: Fri, 23 Jul 2021 01:18:56 -0700 Message-ID: Subject: Re: [PATCH v3 1/2] mm: introduce process_mrelease system call To: David Hildenbrand Cc: Michal Hocko , Shakeel Butt , Andrew Morton , David Rientjes , Matthew Wilcox , Johannes Weiner , Roman Gushchin , Rik van Riel , Minchan Kim , Christian Brauner , Christoph Hellwig , Oleg Nesterov , Jann Horn , Andy Lutomirski , Christian Brauner , Florian Weimer , Jan Engelhardt , Tim Murray , Linux API , Linux MM , LKML , kernel-team Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 23, 2021 at 1:15 AM David Hildenbrand wrote: > > On 23.07.21 10:11, Suren Baghdasaryan wrote: > > > > > > On Thu, Jul 22, 2021, 11:20 PM Michal Hocko > > wrote: > > > > 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? > > > > > > I was thinking if this syscall implements "best effort without blocking" > > approach then for a more strict usage user can simply retry. However > > retrying means issuing another syscall, so additional overhead... > > I guess such "best effort" approach would be unusual for a syscall, so > > maybe we can keep it as it is now and if such "do not block" mode is > > needed we can use flags to implement it later? > > The process is dying, so I am not sure what we are trying to optimize > here in respect to locking ... Trying not to block the caller, which is likely a system health monitoring process. However, if not blocking is important, it can issue this syscall from a separate thread... Let's scratch that "do not block" mode and keep it simple as it is now. > > > -- > Thanks, > > David / dhildenb > > -- > To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@android.com. >