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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4DBF5C02192 for ; Mon, 3 Feb 2025 18:07:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 636B06B0085; Mon, 3 Feb 2025 13:07:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5E8D86B0088; Mon, 3 Feb 2025 13:07:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4D4386B0089; Mon, 3 Feb 2025 13:07:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 300436B0085 for ; Mon, 3 Feb 2025 13:07:05 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id A792BAEFC2 for ; Mon, 3 Feb 2025 18:07:04 +0000 (UTC) X-FDA: 83079414768.07.2616511 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf21.hostedemail.com (Postfix) with ESMTP id 7F9511C001E for ; Mon, 3 Feb 2025 18:07:02 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Hp2CtZeY; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf21.hostedemail.com: domain of oleg@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=oleg@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1738606022; a=rsa-sha256; cv=none; b=htShC+HrV2WMRbd3TQyghWPMz0ZXM23NDjJ21kwar1HohwuJh2aDte+YpNMIcuTkW0Aqsp vDEEWe0j4TzTC9IILpFCpeYwcJerKq9XYLD7Gah6nhrB2xV09kt3yFmcUgtVcbSxfSu+5A otgZdT02kIpsIukOz9XSqqDE5NBFpB8= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Hp2CtZeY; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf21.hostedemail.com: domain of oleg@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=oleg@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1738606022; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=HoR1erBVMX8VBp6WUmDQP6ZxA7W4c1/eAF6F57NZd2A=; b=fFlmsYvCC5HwGylLiE+Ay7RxUhpqeqhguDHuoUf+W63DmEFt6K4tQvsPaPYTaGwMAeBWZS xdjdcgpJdkm7GyZMOXoTBqmnH4bqP/gP5fXkxH9us9n+nTl+uyib2qk+4UHgqyZxV0Bag9 cMQr2gE3eT2NrSxFH8CsFzWtAUOYj8E= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738606021; 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=HoR1erBVMX8VBp6WUmDQP6ZxA7W4c1/eAF6F57NZd2A=; b=Hp2CtZeYR2/YJj8lbVfTgXw0Xd+EUVtHwzWYD9xJrXMeAoczWVSQQknXUKpXrg0ZtKzngy iocvsFWFahtB7pQwIOsjLeaqZuTwT3uWcd9lKdPHwrSdg1efK8MV08b7rSLbdVOWa4hRBE S1MJJGgN6zegdglqNKplbcjpIy5SmTo= 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-287-u33-V2S4Mr6gz2nWm72n5Q-1; Mon, 03 Feb 2025 13:06:56 -0500 X-MC-Unique: u33-V2S4Mr6gz2nWm72n5Q-1 X-Mimecast-MFC-AGG-ID: u33-V2S4Mr6gz2nWm72n5Q 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 DBB0619560B4; Mon, 3 Feb 2025 18:06:53 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.224.72]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 328DF19560AD; Mon, 3 Feb 2025 18:06:50 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Mon, 3 Feb 2025 19:06:27 +0100 (CET) Date: Mon, 3 Feb 2025 19:06:24 +0100 From: Oleg Nesterov To: Mateusz Guzik Cc: ebiederm@xmission.com, brauner@kernel.org, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 3/6] exit: postpone tty_kref_put() until after tasklist_lock is dropped Message-ID: <20250203180623.GC1003@redhat.com> References: <20250201163106.28912-1-mjguzik@gmail.com> <20250201163106.28912-4-mjguzik@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250201163106.28912-4-mjguzik@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 7F9511C001E X-Stat-Signature: uhngyopqgf8hghym8akky7951ubzdxe9 X-Rspam-User: X-HE-Tag: 1738606022-545417 X-HE-Meta: U2FsdGVkX1+XNnddB486bYYeFWG5+WpgNubBtP5MKvjTDtqultNuA1/Eovke6dtEHZbAM7mTdRlEWUaw9nTJveDzJwr357i3bJC+6uTlnXfeBK/p/KZI2TBPEsbt1t0LQ+d29PAAG5YMy7/sn7VK/ZI/Ah0FcX9XJgh60lVmfGCwY0c2wq4h2m0hnVpvYm+f9aP886fpR2d+zv9LggI1trjctA9CbbqBING/UOwRWE12xolaACA0cf/b7YUf8kjCKelcfdjIejYNz07Rg12JoTM1v1Dqu56RRdsutnVQKo5GfZ6XTaDRXjgJaQ/Tv/GjLA4mL4szsFQNS3haxhNdbLM+eL/J+DbNFivLBq/pf8OxOqBxLKPELDHD7lSVCv6P24C5Jzc/pLJErXddYxGDJZhv96p0ZFUkUISQ6cEDqjKYxipDFuUAirII2Yi8a577a8xM1hhzKHcpumaVe1b9puPSEeKIQFlvF4HD1QZuY0wzTAGKHQgEB4UF44V88IRrnokxUM/HHQkYDV0o/0t9yx/2q1WxIbR/g4fad4HW1bl84+YcBQKw9bBf1a2oNiCS3znFj/wROozR1YKkkA9GNbtOtIPaQ7weZMcp2JfgJvOnRQCUg6QSzECBvYa0/pX6wdp4O4C9Becmy98Tl12SAidWzKlyrELFdmuDpkUMIoDAUS8IuL8spCDS1CctsZA+L33n1AMzMwulKSljGxIXmRlx7AsOGEiPUxFZoGbltp3SadtCtmXq5Yxo69+ZwgI9hogPKfujgbyJAYBVtoDdxCqh1UHlpAPb5alP06qXdGh+WXw21h0BH4aW8e5FRfUjaKCXEYncJbdk6THVsaEZ6167pAAHJWxO24OKbNgTpa17/QOL1LG28sBq407F/rvBUR6Bz6fV77l09Zc7aZLbjtW2LwS9yNnv358rc1Up+yzUDs0gBAa3rAaF9vSzYHjihEO1VdMIMdy1ry42Pc7 1tGuipYs EWL2etfxn/qGW/ONe6TzkcrR2eF2ZzE2tiCr/u3650U+yi8+GLbTheP1gGCYf/0pwh/qDV0imvtRuD7o1QhoSM8uCG192SkDOoS1GDUgpg2ppziBTRWunALJlavugzAUXoa1KRbW+q+E4Ww7D2zmQE4ienxw/l372KN6rEeVswi1rV9Lsy9xw2LjueuexEEyICbtHGHVBBBSVSRpRwEi5tDIvU1JhWZvr6LE8ruWPBWeVdgr4Ca0+BPTn1dKf5yT2SNoVBERo+LEWitcd1PEssclLymkC87nuTxOkK/sIhzMEl7zeko728d9lp3hfiXB79lNHZGebHOd6YWvzPD+Zx8gtj4xEY7Nyle7b 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: List-Subscribe: List-Unsubscribe: On 02/01, Mateusz Guzik wrote: > > Instead of smuggling the tty pointer directly, use a struct so that more > things can be added later. I am not sure this particular change worth the effort, but I won't argue. I'd like to know what Eric thinks. OTOH, if we do this, then perhaps we can do more "call tty_kref_put() lockless" changes later. And perhaps even add the new void tty_kref_put_sync(struct tty_struct *tty) { if (tty) kref_put(&tty->kref, release_one_tty); } helper. With this change release_task() doesn't need to abuse schedule_work(), and this helper can have more users. Nevermind, this is almost off-topic. Oleg.