Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2789263ybk; Tue, 12 May 2020 08:11:42 -0700 (PDT) X-Google-Smtp-Source: APiQypL3eop/h6L3oXJ/Ox7TpgdKVQo1FV3Zol4Li5K/MGmtWRxzzNur8eFKmt/ECS97H8wkknpa X-Received: by 2002:aa7:d518:: with SMTP id y24mr17546412edq.222.1589296301869; Tue, 12 May 2020 08:11:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589296301; cv=none; d=google.com; s=arc-20160816; b=ssfynJw2E9pWJqtj9tRvCuLIM9A2JLbFFB8y1qAUgFDVWLkjvwna5fzzLKwV4TO9Wy WQtL3sJm5/8HRyHCtI/F69irxg0uWr7hvwZMTwJVI9Tl0kXw3lWmtcJtmy7DIq+jZ4by thDd9J1M7dtC8crM8qlxuHAjw6hWIJQK2UUse4BmT6vQZ3QCtM8WLtNmC0leTnw83ME0 RKTQwLRL5jml2AwUUgURLzWLyyQIy63plUvdeT+8pba9xrL9oQLBZoN5REsroMMAz1VF Hk8jrbPSzYnKlwSH21F8Pw1TyCYJEG/PiRyWg+aW1fMe6a2sYeU2GOy/Y3QSkoWtHQyw Qxmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=o3mzHOjyJBVl0+9NmeI1isPR/7RdebGvNkEnyKCfdAo=; b=RbF6hPIhkjxnk3XrFxl6QA5vw4hp4pyUahP0hqnfmoaCfzztCWVdfQdSHhrV9Cw3u8 2SA9ZWZYH6nZbO+qfrIVUXiug2GdKtVGYByIG6CvG5d6ICYAL0p1NWs63LX8Z1maXw5/ Tew0tJC9Cz6nflsZxUb1qOORqY+kgMxDnJ7T73UVSaqHwPbDdTP28eIRjPzBrIPruNk4 HCKRMUzxGdRYGRICXSGj2v9CLE8oT5hmnMQ0K7+OxFtITJ3IYbm3xmR01xJwGnkl1kit SkX+42HsU67ZY0UfEoD5wMlHEQlnvwZWnpCwsMO2T6Tm2Q44dlWUcxZOlacbbfy+UGN0 CjUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UUKlOSrj; 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 s26si8103167edq.433.2020.05.12.08.11.17; Tue, 12 May 2020 08:11:41 -0700 (PDT) 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=UUKlOSrj; 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 S1727978AbgELPJr (ORCPT + 99 others); Tue, 12 May 2020 11:09:47 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:33217 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727844AbgELPJr (ORCPT ); Tue, 12 May 2020 11:09:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589296186; 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=o3mzHOjyJBVl0+9NmeI1isPR/7RdebGvNkEnyKCfdAo=; b=UUKlOSrje9UV8aekJ4OtX22lBoG3WdhAsQlxMSGtHzsmUG5uP2VG+eROewIe8tE/Lb86tW qlpPa5NKlTr8hNj+I0nIB2N+CESYYi+C2tj6qg7touldH+bm1l8u2HJkPE/QmnxNKqDgw9 Px2/op+TQD9juKt3MuS4pnO7eaT18q8= 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-258-CPQ8ZxIfM4OqdKjiM42LYw-1; Tue, 12 May 2020 11:09:42 -0400 X-MC-Unique: CPQ8ZxIfM4OqdKjiM42LYw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D6CB8100CCC0; Tue, 12 May 2020 15:09:40 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.40.195.92]) by smtp.corp.redhat.com (Postfix) with SMTP id EAC6F5D9DD; Tue, 12 May 2020 15:09:38 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 12 May 2020 17:09:40 +0200 (CEST) Date: Tue, 12 May 2020 17:09:37 +0200 From: Oleg Nesterov To: Davidlohr Bueso Cc: akpm@linux-foundation.org, peterz@infradead.org, paulmck@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, Davidlohr Bueso Subject: Re: [PATCH 1/2] kernel/sys: only rely on rcu for getpriority(2) Message-ID: <20200512150936.GA28621@redhat.com> References: <20200512000353.23653-1-dave@stgolabs.net> <20200512000353.23653-2-dave@stgolabs.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200512000353.23653-2-dave@stgolabs.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/11, Davidlohr Bueso wrote: > > Currently the tasklist_lock is shared mainly in order to observe > the list atomically for the PRIO_PGRP and PRIO_USER cases, as > the actual lookups are already rcu-safe, not really... do_each_pid_task(PIDTYPE_PGID) can race with change_pid(PIDTYPE_PGID) which moves the task from one hlist to another. Yes, it is safe in that task_struct can't go away. But still this is not right because do_each_pid_task() can scan the wrong (2nd) hlist. > (ii) exit (deletion), this window is small but if a task is > deleted with the highest nice and it is not observed this would > cause a change in return semantics. To further reduce the window > we ignore any tasks that are PF_EXITING in the 'old' version of > the list. can't understand... could you explain in details why do you think this PF_EXITING check makes any sense? Oleg.