From patchwork Tue Jan 7 16:26:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Nesterov X-Patchwork-Id: 13929302 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CF6471F37BE for ; Tue, 7 Jan 2025 16:27:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736267249; cv=none; b=mvEhF0NZ1YT8+6PRcNxnERPTiUPi2eTOwjsnnhA8FvN5T0f8Sylpdsaf8CaL36VtVtF38SuZIbQwmxoLFjBSKOhU+kpydwavjpuSCq8pPe3MZ/EOkBUIXvfeSNMpR8d0aVrgbCxB+9/MWMI6iLQC+GsUffi4z9onE0kVlrpTBC4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736267249; c=relaxed/simple; bh=yGuRD7QZk6cYtj4E9Vk0EzX46qN+zYWmpGqZmS/1I5s=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=icinw2lWaAEBBFcM9DZieRiSk4F7VbJGnJoHtjDDtj+FSZ+1yp2BMaC3xB/tTP5zZZDgRnPs0kRM8WuJL0bWTWbtOR1PP67UDDnS7EqMcjLvrlYRUCwfvbG15L7hLLaYKqYHJdvYNAbssshvFMmtYlZY008z8MhKGolO9oFsapo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=JAYMe8QX; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="JAYMe8QX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1736267246; 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; bh=yysKQ0vVyHHixdI3EvvINEv3gtl53bkWe5u1MGCf7qg=; b=JAYMe8QXQxTiTZL2aDX8Hg20xocCmYqQwyrLHVzc4IWr9IbxcUaMmckCOJpSJyJ5lMuArs cPZpfslyUGa4G6ELYSdmgRedBE8+Qci5IZy5TGFkiR9dbeGhtjiGaa0vlY0BwsdgNSuojJ V9lxbjeZOVNzN/3r17R+XqV0CYnDaRk= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-456-tD2jZvbsMu-YwFIpvXlP_Q-1; Tue, 07 Jan 2025 11:27:23 -0500 X-MC-Unique: tD2jZvbsMu-YwFIpvXlP_Q-1 X-Mimecast-MFC-AGG-ID: tD2jZvbsMu-YwFIpvXlP_Q Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 308F21955F69; Tue, 7 Jan 2025 16:27:20 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.226.23]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 099C2195606C; Tue, 7 Jan 2025 16:27:14 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 7 Jan 2025 17:26:55 +0100 (CET) Date: Tue, 7 Jan 2025 17:26:49 +0100 From: Oleg Nesterov To: Christian Brauner , Linus Torvalds , Manfred Spraul Cc: "David S. Miller" , Eric Dumazet , Jens Axboe , Pavel Begunkov , WangYuli , linux-kernel@vger.kernel.org, io-uring@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 0/5] poll_wait: add mb() to fix theoretical race between waitqueue_active() and .poll() Message-ID: <20250107162649.GA18886@redhat.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 Linus, I misread fs/eventpoll.c, it has the same problem. And more __pollwait()-like functions, for example p9_pollwait(). So 1/5 adds mb() into poll_wait(), not into __pollwait(). WangYuli, after 1/5 we can reconsider your patch. Oleg. --- include/linux/poll.h | 26 ++++++++++++-------------- include/net/sock.h | 17 +++++++---------- io_uring/io_uring.c | 9 ++++----- 3 files changed, 23 insertions(+), 29 deletions(-)