Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1160008ybb; Wed, 25 Mar 2020 17:14:50 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuiWUM84svDwcwrqFC6DmYUldPIRSRSX7Z/SkV2PF0qpjKikgBwAxncZ2Wa+8m+Nw/LvhU1 X-Received: by 2002:aca:eac2:: with SMTP id i185mr107851oih.31.1585181689886; Wed, 25 Mar 2020 17:14:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585181689; cv=none; d=google.com; s=arc-20160816; b=a3ESDw+BrwcCR89DBXcJdT1RsI/XuHz2lxpfdYK0LVUK6nJrEtt3HreUJDnxvxlbF7 /+2Nh2svhPCCC79HguJ7qJebyhrVI+NcHR0qumxBIG1bBo6ccRQvn+r857VFxbdIfek9 czPZ9890O7gUenBEs/8AiCLxi0s9jhxOCBnNHHsE4qkrEFPQWE2/5Gr53ZBpYW21BYp+ 4GhtDoTd3ktcTKGU9VRr5s30/0nonfz6b0XDPGEEmya7W9QMJ7YROpszOXGXD3CexplE DqFglrE2YptAMPXSRj9gjRyWAa7kkk7f1PF5qqaNAOECKWro15mkx0wpOxfLcVgMK/LT ChaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=S7Sc2duj77D7JUnGMQoCkHU904ydcBEnNRzF9FLm+YI=; b=1KtkIZAGve0hiZtQENZoCoUQiV85s63LTT3SzEkFO/5N2OhAjSL5yItlVrJryn51li rV5chZ/ZuJTMtYkrcnikos+6aYXUl6P3WLjs0oGGvc2H1ReftlAxSdx9Z0UP41xJYPy6 dLOdr/zFqj66HMTs1PELf8Ufv9MDpb1BF7dwaWD/ibjg06VByVTJlf/liRNC0/j4bq2r FJHdzzP8KLLsccoxBftX3t9hOdpqGJ+K8x3vVrOhHzCV1HoJWCLeqkkz/AWJt3YuKJO3 R16iX/Qk188tCIoUO2CUdTxg4kCwjCV/VjHLwVcEwS21d/mAVSn4hK38hJRhVE/sjHXW vRYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RlP8ohqH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f129si266636oia.243.2020.03.25.17.14.37; Wed, 25 Mar 2020 17:14:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RlP8ohqH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727564AbgCZAOV (ORCPT + 99 others); Wed, 25 Mar 2020 20:14:21 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:44682 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727498AbgCZAOV (ORCPT ); Wed, 25 Mar 2020 20:14:21 -0400 Received: by mail-qt1-f194.google.com with SMTP id x16so3874232qts.11; Wed, 25 Mar 2020 17:14:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=S7Sc2duj77D7JUnGMQoCkHU904ydcBEnNRzF9FLm+YI=; b=RlP8ohqHvEQkTK5kGgiSBl6WH15PaVWtiHB0v1Iv/6+Vfb7Eka28N35XydaiEqMzR/ jyu0O0ohpyMxX4ljdq7uAa05nGe/pUIyNc9EcCYEbxQw9WHup+M3MJlOoqNaH7GaJ2yj IIL3xL3riXneubS0jgb8qcUWmvFUyfQDfxyG8dEmm56J0BIvzPHd9zdvAocR0scnEneT ytPm34ox8nq05DzF6Ndfs7FOgsEZUd5mtuxinmQv/6KP2RC9XOVR3AE081hTqJaNTNcC SwPCUuoNv6teuL1fTt1fk5V6SCKAiCa9FQmkBJahwk8h5XoEJOdj7j1iApionCMf+WdI VOZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=S7Sc2duj77D7JUnGMQoCkHU904ydcBEnNRzF9FLm+YI=; b=JeN73LHIHRj/Ot6qfymUEkqFZCOq8Z1sowgVqkWna2PPHAmrKStznoh/YpIYlkJSEy VjZ3FlXTUoYGJCp2XW0y/3Ucf8FcHOiu2Lgmc5sfhsCndulgvXEW8en3PmEbg6aRamhH bUlIsgeu5qLOXapdShMfOWdJi+bFEIpApoFoA9xf98gxDLKsqbKyaO/ghEkWzyMF1Sz/ FMpgp0dO4TAfy3PcIfjw++ON2iRpQFYauLKunrXR8n7CxP8rC1lhVb6jfMMmk0NuBe2C yoektX9YOA4PeaZ1IcESiZ731A9cxAdUrM3he/rt7n512ftSRZAP8TGS4jFNkBOnBNqM PwmA== X-Gm-Message-State: ANhLgQ2Lyeh0qNteFNqizwUPyRW6B6J3lys4fjq5+SoSdnBpzk2Z7EKo q524Aw5g0AXLlLhDtTjM4zU= X-Received: by 2002:ac8:568b:: with SMTP id h11mr4420271qta.105.1585181659543; Wed, 25 Mar 2020 17:14:19 -0700 (PDT) Received: from localhost.localdomain ([2001:1284:f028:d8e3:b319:cf5:7776:b4d9]) by smtp.gmail.com with ESMTPSA id 82sm340437qkd.62.2020.03.25.17.14.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Mar 2020 17:14:18 -0700 (PDT) Received: by localhost.localdomain (Postfix, from userid 1000) id 4C55BC5CE4; Wed, 25 Mar 2020 21:14:16 -0300 (-03) Date: Wed, 25 Mar 2020 21:14:16 -0300 From: Marcelo Ricardo Leitner To: Qiujun Huang Cc: davem@davemloft.net, vyasevich@gmail.com, nhorman@tuxdriver.com, kuba@kernel.org, linux-sctp@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, anenbupt@gmail.com Subject: Re: [PATCH v4] sctp: fix refcount bug in sctp_wfree Message-ID: <20200326001416.GH3756@localhost.localdomain> References: <20200322090425.6253-1-hqjagain@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200322090425.6253-1-hqjagain@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 22, 2020 at 05:04:25PM +0800, Qiujun Huang wrote: > sctp_sock_migrate should iterate over the datamsgs to modify > all trunks(skbs) to newsk. For this, out_msg_list is added to s/trunks/chunks/ > sctp_outq to maintain datamsgs list. It is an interesting approach. It speeds up the migration, yes, but it will also use more memory per datamsg, for an operation that, when performed, the socket is usually calm. It's also another list to be handled, and I'm not seeing the patch here move the datamsg itself now to the new outq. It would need something along these lines: sctp_sock_migrate() { ... /* Move any messages in the old socket's receive queue that are for the * peeled off association to the new socket's receive queue. */ sctp_skb_for_each(skb, &oldsk->sk_receive_queue, tmp) { event = sctp_skb2event(skb); ... /* Walk through the pd_lobby, looking for skbs that * need moved to the new socket. */ sctp_skb_for_each(skb, &oldsp->pd_lobby, tmp) { event = sctp_skb2event(skb); That said, I don't think it's worth this new list. Marcelo