Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp406817ybj; Tue, 5 May 2020 00:31:13 -0700 (PDT) X-Google-Smtp-Source: APiQypKe8Z1NvdQqGyrBlm9GgaOuB5pXIYW1ZfmuHRGYMcTO6r41UDGLyziulbXWOfAdZHe1E0Jb X-Received: by 2002:a05:6402:1757:: with SMTP id v23mr1430143edx.335.1588663873748; Tue, 05 May 2020 00:31:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588663873; cv=none; d=google.com; s=arc-20160816; b=TEpfP9xVMHrDmd0XNHuoTMIV67WbRkIMDDwW14sv2HIyOPK1mZTG9JBgGHHw5N+Du2 RdSk1WVetU5LROAn/ezRcNYmZtePrd1hj8NlknSaUsfE1hkmFOuu5VUIz+c1qISSl/az BlGu5H/KGyeTR2qpLM016QoNZ7y+ji4AdgGbk3lhyzafFy3DmkN/c7UPkXcrW8ZhuYDV EFgqu16dvlh4OSDUvwEIyef+7nMWlM7KrG0c5sMEBGm+z7eBJPVmNnJzLXaV1HW94S/h Mls0TAPvAp55z3u5KUEcmxirYPEYx1cjX0RKiG4dnzBxWI0/p7q8f/L5qlrhyUW9DNVs f/Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:dkim-signature; bh=Dy5GnfEjGnJjJR9G7/r4lahXKQYYs/PILtEzR0YenFs=; b=yNfA+TLQhzIIlZuybWu7+q6vlIMvm4yC1He1l/nqsRIcemjttAAqc8MiBiRVQL1dJn lhA7Mblame+9vV8mZx1l7XT7fWyKcQLZbmB5iWFc+8qtqdz66mJuawzWu99dv+Oa3qUe bDvnoINumz3Ih8YjcisCo1SvQmhCL7nktg+ITdXCFmh2cOgYI6ymBsxFdnXrYwGf5c36 eQfIQbqO/xrh7119nNO19kAf7QzkczKmin+T7TvZf2hLmQHPTSINU708UT068AlkTF4L F4wNZbL+qAQ28xAibInL2R3rJjx0ZPTLzGMuPukAmyu8eK37KmbhfYih0t+ZM+OHJ8BT sehg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=p8d81vvP; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m10si816731edr.459.2020.05.05.00.30.51; Tue, 05 May 2020 00:31:13 -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=@amazon.com header.s=amazon201209 header.b=p8d81vvP; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728351AbgEEH32 (ORCPT + 99 others); Tue, 5 May 2020 03:29:28 -0400 Received: from smtp-fw-6002.amazon.com ([52.95.49.90]:51258 "EHLO smtp-fw-6002.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725320AbgEEH31 (ORCPT ); Tue, 5 May 2020 03:29:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1588663766; x=1620199766; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=Dy5GnfEjGnJjJR9G7/r4lahXKQYYs/PILtEzR0YenFs=; b=p8d81vvPmILMDDDJWCeejpWnszuZBZKj8XUapdaD6vHEaFb3Udl1yATM PMZrV2eZ2PvhRUPQmrYBLdRIQCQAx6utEdKLBVqzE935X0U71AwTRjAMU ashB/SdHMTHqjfYgcV5KB3If/QWcJdJaeUA4vR/hdvdK7unOgVcjvbtwR Q=; IronPort-SDR: wiFJuqrdmzV+svAi58Tshev5UQb3eCtzreDDcALkcPEXaMHn2+5Rw/TWukgwUi9CXW1XE0Ztou tYxNj/pStu2Q== X-IronPort-AV: E=Sophos;i="5.73,354,1583193600"; d="scan'208";a="28646179" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2b-a7fdc47a.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-6002.iad6.amazon.com with ESMTP; 05 May 2020 07:29:13 +0000 Received: from EX13MTAUEA002.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2b-a7fdc47a.us-west-2.amazon.com (Postfix) with ESMTPS id 8B250C5D95; Tue, 5 May 2020 07:29:12 +0000 (UTC) Received: from EX13D31EUA001.ant.amazon.com (10.43.165.15) by EX13MTAUEA002.ant.amazon.com (10.43.61.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 5 May 2020 07:29:11 +0000 Received: from u886c93fd17d25d.ant.amazon.com (10.43.160.180) by EX13D31EUA001.ant.amazon.com (10.43.165.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 5 May 2020 07:29:07 +0000 From: SeongJae Park To: CC: , , , , , , SeongJae Park Subject: [PATCH net 2/2] Revert "sockfs: switch to ->free_inode()" Date: Tue, 5 May 2020 09:28:41 +0200 Message-ID: <20200505072841.25365-3-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200505072841.25365-1-sjpark@amazon.com> References: <20200505072841.25365-1-sjpark@amazon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.160.180] X-ClientProxiedBy: EX13D20UWC003.ant.amazon.com (10.43.162.18) To EX13D31EUA001.ant.amazon.com (10.43.165.15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: SeongJae Park This reverts commit 6d7855c54e1e269275d7c504f8f62a0b7a5b3f18. The commit 6d7855c54e1e ("sockfs: switch to ->free_inode()") made the deallocation of 'socket_alloc' to be done asynchronously using RCU, as same to 'sock.wq'. The change made 'socket_alloc' live longer than before. As a result, user programs intensively repeating allocations and deallocations of sockets could cause memory pressure on recent kernels. To avoid the problem, this commit reverts the change. --- net/socket.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/socket.c b/net/socket.c index e274ae4b45e4..27174021f47f 100644 --- a/net/socket.c +++ b/net/socket.c @@ -273,12 +273,12 @@ static struct inode *sock_alloc_inode(struct super_block *sb) return &ei->vfs_inode; } -static void sock_free_inode(struct inode *inode) +static void sock_destroy_inode(struct inode *inode) { struct socket_alloc *ei; ei = container_of(inode, struct socket_alloc, vfs_inode); - kfree(ei->socket.wq); + kfree_rcu(ei->socket.wq, rcu); kmem_cache_free(sock_inode_cachep, ei); } @@ -303,7 +303,7 @@ static void init_inodecache(void) static const struct super_operations sockfs_ops = { .alloc_inode = sock_alloc_inode, - .free_inode = sock_free_inode, + .destroy_inode = sock_destroy_inode, .statfs = simple_statfs, }; -- 2.17.1