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.3 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 69CE7C4338F for ; Fri, 23 Jul 2021 08:15:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CB72060F02 for ; Fri, 23 Jul 2021 08:15:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org CB72060F02 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 570E26B005D; Fri, 23 Jul 2021 04:15:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4FA276B006C; Fri, 23 Jul 2021 04:15:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 39C766B0070; Fri, 23 Jul 2021 04:15:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0028.hostedemail.com [216.40.44.28]) by kanga.kvack.org (Postfix) with ESMTP id 1CA8D6B005D for ; Fri, 23 Jul 2021 04:15:38 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id ABC62141CE for ; Fri, 23 Jul 2021 08:15:37 +0000 (UTC) X-FDA: 78393143514.07.FB397DF Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf28.hostedemail.com (Postfix) with ESMTP id 0698B9009F1C for ; Fri, 23 Jul 2021 08:15:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627028136; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PsOmQhhV5hj9QM8KqB7droIKpWy0pXqJreEnaRUzjas=; b=NMO2bIES7x8VEdFftst99FuV+eiiKbejXpSZ0F3eL4+RnjdGCiqHSCoBM/cI06j23ATT1Q nojos2kkaNuQxUF9xzeOOFRKcUyUyGEGHxJGwY7UK26LfYeCKFlCWYPD90yVR0ahINOHeY RMLrM0eNE9wDCamg6radT7EhPYxb4VQ= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-124-GY7KqzRyMzy2vybii-ga7g-1; Fri, 23 Jul 2021 04:15:33 -0400 X-MC-Unique: GY7KqzRyMzy2vybii-ga7g-1 Received: by mail-wr1-f71.google.com with SMTP id v15-20020a5d4a4f0000b0290141a87409b5so677516wrs.16 for ; Fri, 23 Jul 2021 01:15:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=PsOmQhhV5hj9QM8KqB7droIKpWy0pXqJreEnaRUzjas=; b=d/BVAUNNKnfNivDz9hO6aU9oF07M7gudUaXNl4mi7GPFAz88VriyDzM/G+Bg5pF1Mp 9mn+zGx8lMMbOj6/X2bTVPPnitiomk0xFDLC5XQoewrTi8tktUSpSHitfkcoR2poAv4n /yDlYYsjzcieeALnKmTMiuCvXJddHR0ZN19OyxmOOsOjO7XBVNO+j9/gHVtFlWRJeCPh aqstlhGlbjBHbrs+wQKd+b0XxJP0a3NN8Q9CEz4niUkvbH0O4ab3XPP1AMrO4HO/0zhW SECAlSwx5hVfqdFwChPsEzWEOC3+GXRU3LEBPsvX8wOQPVc3u77lv6AIjnxetQ2dzL4d LPDg== X-Gm-Message-State: AOAM530qBoZVqIp5vejUXIRH3S0X4go+oOINV6PP3UM336VWhYEmKEIc kybu97y4+i5XKrgmzRoTJUAPklpDJNps/2Y8swzwvXgKQymzefaBw+2NBEmBYHMNhsIpBVqa6C1 N5jw2ISAxOgU= X-Received: by 2002:a05:600c:4105:: with SMTP id j5mr3338921wmi.49.1627028132074; Fri, 23 Jul 2021 01:15:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7Rr4Psd5MxeJacADEM5uXfuPl/hj7wRYNdObU8hvGa0HGoP8+m60PyLjmuurv4Hl+GMy/zQ== X-Received: by 2002:a05:600c:4105:: with SMTP id j5mr3338884wmi.49.1627028131852; Fri, 23 Jul 2021 01:15:31 -0700 (PDT) Received: from [192.168.3.132] (p5b0c676e.dip0.t-ipconnect.de. [91.12.103.110]) by smtp.gmail.com with ESMTPSA id j23sm4305407wmo.26.2021.07.23.01.15.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Jul 2021 01:15:31 -0700 (PDT) Subject: Re: [PATCH v3 1/2] mm: introduce process_mrelease system call To: Suren Baghdasaryan , Michal Hocko Cc: 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 References: <20210723011436.60960-1-surenb@google.com> From: David Hildenbrand Organization: Red Hat Message-ID: <23ed1d8d-fe55-fdbc-ca33-01a3ce392dff@redhat.com> Date: Fri, 23 Jul 2021 10:15:30 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 0698B9009F1C Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=NMO2bIES; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf28.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=david@redhat.com X-Stat-Signature: dquhf7sa3b4a1bt48dq8ciou9e3iofe7 X-HE-Tag: 1627028136-727184 Content-Transfer-Encoding: quoted-printable 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 23.07.21 10:11, Suren Baghdasaryan wrote: >=20 >=20 > On Thu, Jul 22, 2021, 11:20 PM Michal Hocko > wrote: >=20 > 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: > > > > > > > [...] > > > > + > > > > +=C2=A0 =C2=A0 =C2=A0 =C2=A0mmap_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. >=20 > Why is that a good idea? Can you do anything meaningful about the > failure other than immediately retry the syscall and hope for the b= est? >=20 >=20 > I was thinking if this syscall implements "best effort without blocking= "=20 > approach then for a more strict usage user can simply retry. However=20 > retrying means issuing another syscall, so additional overhead... > I guess such "best effort" approach would be unusual for a syscall, so=20 > maybe we can keep it as it is now and if such "do not block" mode is=20 > needed we can use flags to implement it later? The process is dying, so I am not sure what we are trying to optimize=20 here in respect to locking ... --=20 Thanks, David / dhildenb