Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp45191pxu; Tue, 24 Nov 2020 18:06:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJwVucLFeKdEoPsWqCxmAPzWQSwMXarfjGXxsCZqay4KDq3Mb/LafMmmO93c97tu/m0y1/uK X-Received: by 2002:a17:906:f88e:: with SMTP id lg14mr1196365ejb.417.1606270003096; Tue, 24 Nov 2020 18:06:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606270003; cv=none; d=google.com; s=arc-20160816; b=cwzD1G86vSO51iEHfyGe9rA18t+pcrmKsJVHVTVU6j2Uv5CqmAERWER+E5t0T+cQkj Uv5Hnzu8ljCUIXsuGVEqfETbg9f8nk/Djjw6CL0rwrBBOUw5g1h8gVVNeXwz7ZpBflJZ UQGNyfO1GPBRro/4J5VeaSZb+jjnqK9ZTbka/K6QwTzVDdfHejUu2l3A4OMLs8iUqeab R1gKGW4jH7VABgoUSUPyMrVywvBj67r8q52oI5tRbb41eLfoVXKRZg69kSNybP1GcfA3 BpcWgGAksttxXtl5hfzdHayDOeudOGY4buyATdK9XM+ZjvBdwvzxwWq8ilPmOan/+Hlt 8Ung== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=WRSwdJak4MDUgdM4oYuwCfc8hhy9ROBWcZnmVAse6LM=; b=Ml4oSN+IKwWmgkzCpVCEkgKRsnETEGW5nKWVej2DYVGLnZCRt/jXDRiVyqGGUedBKj YmBPE6236VKlehhelEt9z3e0YYbPJIucew24c1pfciULnLP0mu7xT850V9Qdab44CygB 0JhdAT/RsCzhAZPxazQHYT/XhPaqXoLRABVCqFVMmCyi8vKAbVfW7nwCtJr4qj/7yK/H dQ1kIeXf3vFnWX55+0kazoJkxGnrg5rGGdrF+8IcGarYExt2CGDVvIjj0/UdD8ZjuF74 /aRP7rt4E9cttQt/0c4y68WFgT9Udt4/xzMFxER1XEfAfKO+XBtk3y4xqapJB6Ju7cO1 k3AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cU44JXOR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m11si362940eda.522.2020.11.24.18.06.19; Tue, 24 Nov 2020 18:06:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cU44JXOR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388506AbgKXNmz (ORCPT + 99 others); Tue, 24 Nov 2020 08:42:55 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:40927 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388496AbgKXNmX (ORCPT ); Tue, 24 Nov 2020 08:42:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606225343; 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: in-reply-to:in-reply-to:references:references; bh=WRSwdJak4MDUgdM4oYuwCfc8hhy9ROBWcZnmVAse6LM=; b=cU44JXORPEi3o3XPL7p0dCL/yexe1O7MDvAMpGncce1V4oTQfwWKcDQH2fIrpP2SS1ccG+ /wOUf5OHsNn9y+l35PPksJrJUEz4WbVGkafvifREafxeowNxFCVtv3cPzUyD4a12b+GWJN mf+pak6/S44MxOq+DKGwBLV3OWTRw58= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-279-Xdhjv9jxPUycYkJDaQ-JWQ-1; Tue, 24 Nov 2020 08:42:18 -0500 X-MC-Unique: Xdhjv9jxPUycYkJDaQ-JWQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 43B72805BEC; Tue, 24 Nov 2020 13:42:15 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.40.195.234]) by smtp.corp.redhat.com (Postfix) with SMTP id 7D7E360875; Tue, 24 Nov 2020 13:42:10 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 24 Nov 2020 14:42:14 +0100 (CET) Date: Tue, 24 Nov 2020 14:42:09 +0100 From: Oleg Nesterov To: Suren Baghdasaryan Cc: akpm@linux-foundation.org, mhocko@kernel.org, mhocko@suse.com, rientjes@google.com, willy@infradead.org, hannes@cmpxchg.org, guro@fb.com, riel@surriel.com, minchan@kernel.org, christian@brauner.io, timmurray@google.com, linux-api@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH 2/2] mm/madvise: add process_madvise MADV_DONTNEER support Message-ID: <20201124134208.GA30125@redhat.com> References: <20201124053943.1684874-1-surenb@google.com> <20201124053943.1684874-3-surenb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201124053943.1684874-3-surenb@google.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/23, Suren Baghdasaryan wrote: > > + if (madvise_destructive(behavior)) { > + /* Allow destructive madvise only on a dying processes */ > + if (!signal_group_exit(task->signal)) { signal_group_exit(task) is true if this task execs and kills other threads, see the comment above this helper. I think you need !(task->signal->flags & SIGNAL_GROUP_EXIT). Oleg.