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 66AF1C4338F for ; Fri, 23 Jul 2021 08:19:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0A70D60EE6 for ; Fri, 23 Jul 2021 08:19:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0A70D60EE6 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 4F8B66B005D; Fri, 23 Jul 2021 04:19:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4A8166B006C; Fri, 23 Jul 2021 04:19:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 36F546B0070; Fri, 23 Jul 2021 04:19:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0220.hostedemail.com [216.40.44.220]) by kanga.kvack.org (Postfix) with ESMTP id 19A0F6B005D for ; Fri, 23 Jul 2021 04:19:09 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id A15421F363 for ; Fri, 23 Jul 2021 08:19:08 +0000 (UTC) X-FDA: 78393152376.22.28260BA Received: from mail-yb1-f179.google.com (mail-yb1-f179.google.com [209.85.219.179]) by imf11.hostedemail.com (Postfix) with ESMTP id 543CAF005408 for ; Fri, 23 Jul 2021 08:19:08 +0000 (UTC) Received: by mail-yb1-f179.google.com with SMTP id l145so1099398ybf.7 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=OLX39gayWek3XTcq9L2AjgE+jEUzruiLqcEBU++IeRpgHED44fN8vxPLrC+OqY9pPQ XOjCxyedsqHK/OVktWbvWLuWUiGGhgVxECyxZXJ8pAqGLkLuk3mW8igb2EBZ0VJCcrA/ uuv65MVhciey22gwcOfm0lVKTjOJlEQCxkQS9F49AfaZ5p9eNtCulwo9jpTs1IH4m9tJ 7xPaa3D1EcI3irzM2i700aKGgK7nAgdlhJfXsKeMaIYZ5YHQjb0hDwsk91I/Yuo01stn T8O8S4xgX9L/IwaysNIeAqItrmnVE6RnoA267C0btfO3ONzAtl/D36XBp/ysYs9iGynW 1oXg== X-Gm-Message-State: AOAM530Hw0Xu9qBtCdTxuqpoc46hTDNEeqNNndge9JcrVdrhUYXQ/ink /Dsw7fcg12KjLwhqo00ce10/d9FGwF5cRjN/1ukg2g== 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" Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=google.com header.s=20161025 header.b=dloDLGg4; spf=pass (imf11.hostedemail.com: domain of surenb@google.com designates 209.85.219.179 as permitted sender) smtp.mailfrom=surenb@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspamd-Server: rspam02 X-Stat-Signature: 47cxyt4hjj8y36x7zcgun5tix1sdaon4 X-Rspamd-Queue-Id: 543CAF005408 X-HE-Tag: 1627028348-242071 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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. >