Message ID | 20230126205721.582612-1-riel@surriel.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp483741wrn; Thu, 26 Jan 2023 13:02:28 -0800 (PST) X-Google-Smtp-Source: AK7set/PcIWuBlN+HJFVUSgQcv+ERtKiARHRJ+SlbYk2zLtXyrfpqrsCe2SjXVv+ZSSUE2bI5hpP X-Received: by 2002:aa7:ca4a:0:b0:4a0:e4b4:4f72 with SMTP id j10-20020aa7ca4a000000b004a0e4b44f72mr2582448edt.19.1674766948319; Thu, 26 Jan 2023 13:02:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674766948; cv=none; d=google.com; s=arc-20160816; b=A4qv2ZHt2k9uBHo/oRWFPWnoEkglheFosNNlD4gW5bTQxHtSk3fVPb2vRTejWyMQXw W4lG9z/Iaf8ZOCzciDJhTo+IfWXWKVhtJwqIOlooXqVkrfqur/s5GzeKNZMR6GgUMKxJ 578zIRkrGPdm4xzLRmPhWEPieZmCXR12y47lrN7h1pmn1DXmNFU1OdXyb0GvOXh3FJB+ ZOtSdpicla+ucXUYNMWwHuRMK0PKQ6EebaYS028Zk2YinQpE+Eg2U3NZMFv9IQS35CaF 8AEfN8BptDdmvBZDyIE7QOF7c5yS47bv2xp45j6hANbzBudWTM1Hh9jOSikI2k0V6wDm F8gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:to:from; bh=TVGuxAs1ZNwLTZLV/OD+cgdSAxnXRcO1NtDPq8SJlPo=; b=egLmtbvirg8w5Sl7X5SkYXVsfgyQTw57lCCop6lzp8OIBmS1w4BC5uYOSjfnU9zfdR 4+rMGsTC446JWPdC6zy5ZVyXw6DTU1VZsHjniB17uBFpFxqJWfM4rTfX5Bbvd7C3jPeq i0xKhGKjdP63UVAVUATJs4ietcB3oeutdrcR+uWi2z3ZjSwFK0V9psFCl7jSvRv5g2ts tjEeeAw0LiYfT+i1C+KvzH3nt85ZDhh5qnj+m502BfAb6mkxPaSLq6XxuFv36hXLoYu9 k96PXT8VidI0AxFyGcfQ3wBwooLWGgkyekbCrJX44FalvQf+PJi9otE37P4ekVtr5kTT QTOA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m15-20020a056402430f00b0048cb4ab0e23si3448016edc.295.2023.01.26.13.02.02; Thu, 26 Jan 2023 13:02:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232492AbjAZU5n (ORCPT <rfc822;lekhanya01809@gmail.com> + 99 others); Thu, 26 Jan 2023 15:57:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230217AbjAZU5l (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 26 Jan 2023 15:57:41 -0500 Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87DB734C08; Thu, 26 Jan 2023 12:57:37 -0800 (PST) Received: from imladris.home.surriel.com ([10.0.13.28] helo=imladris.surriel.com) by shelob.surriel.com with esmtpsa (TLS1.2) tls TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from <riel@shelob.surriel.com>) id 1pL9JN-0001D5-1b; Thu, 26 Jan 2023 15:57:33 -0500 From: Rik van Riel <riel@surriel.com> To: linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk, kernel-team@meta.com, linux-fsdevel@vger.kernel.org, gscrivan@redhat.com Subject: [PATCH 0/2] ipc,namespace: fix free vs allocation race Date: Thu, 26 Jan 2023 15:57:19 -0500 Message-Id: <20230126205721.582612-1-riel@surriel.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: riel@shelob.surriel.com X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756120427307573983?= X-GMAIL-MSGID: =?utf-8?q?1756120427307573983?= |
Series |
ipc,namespace: fix free vs allocation race
|
|
Message
Rik van Riel
Jan. 26, 2023, 8:57 p.m. UTC
The IPC namespace code frees ipc_namespace structures asynchronously, via a work queue item. This results in ipc_namespace structures being freed very slowly, and the allocation path getting false failures since the to-be-freed ipc_namespace structures have not been freed yet. Fix that by having the allocator wait when there are ipc_namespace structures pending to be freed. Also speed up the freeing of ipc_namespace structures. We had some discussions about this last year, and ended up trying out various "nicer" ideas that did not work, so I went back to the original, with Al Viro's suggestion for a helper function: https://lore.kernel.org/all/Yg8StKzTWh+7FLuA@zeniv-ca.linux.org.uk/ This series fixes both the false allocation failures, and the slow freeing of ipc_namespace structures.