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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C5F6C4332F for ; Fri, 9 Dec 2022 12:38:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229962AbiLIMiZ (ORCPT ); Fri, 9 Dec 2022 07:38:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229936AbiLIMiR (ORCPT ); Fri, 9 Dec 2022 07:38:17 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E919A66CBF for ; Fri, 9 Dec 2022 04:37:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670589435; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kKcc7XQPg0UZn1AHNfQ4N2d5zF9JzBW3g3hPGFAB4Kc=; b=ZG3qqAatQhAgpOboJAhhAnXOsAls6GT3djKhXpAx8qhAmpWP+j5Ewoo4/diUxYxZxAhmAx IsB4N7gRUZDNj5yOs+yBwaGHPcGpIAQwcjkCOeZuP6frx+KIOVT+ppWBotynfu9bGbnIWY PFnFWXmmPhUxIB2B9Yq/ZGaPsueGibY= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-437-O7JaO8ZlP_OiR-SAniCYWw-1; Fri, 09 Dec 2022 07:37:14 -0500 X-MC-Unique: O7JaO8ZlP_OiR-SAniCYWw-1 Received: by mail-wm1-f69.google.com with SMTP id m17-20020a05600c3b1100b003cf9cc47da5so2333115wms.9 for ; Fri, 09 Dec 2022 04:37:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=kKcc7XQPg0UZn1AHNfQ4N2d5zF9JzBW3g3hPGFAB4Kc=; b=ZioRalnaqvc5oBzcDOD0h1ITnr/yoSBSayFQyxL7dPkER0vsQN3j9vqVpA20pOZQiJ UE0YCyvcqr5s2u9n3Pk7ketSHnDiizhtziIVnFA/xT93CY+8Fu/qzjJv7Ep3RcaY5rwx et6EXOxGEqQqvo9F5bqmu14Ew/agBaBTwvWvg2Hrtn1RXyrMo8jlpMgp5ZntpxisjP/t 8x1Kl7VJDyH9E/7hLoranz8yFiyrIY6s/XiOr0YzA33H8OkIpAS0DGbRUJTFWjhElQ5y r3Fck/RNSFtFIDyww+AzkLmWtI1QW6umdSu6jk2Wnh5po0sAchxykvYqWsqvT+aivvu/ ewcA== X-Gm-Message-State: ANoB5pmTZB2nQPUBnB7yawSQbfMw8UKoBls7WcIiPfDOXy4IFvEvL3Pf XK9PQVKiEfHMni5uedShpztuWGuMNXlM+l/p+/AlutGJIccj+6TcYUqqIEC6L7yoXRomnyGmCf3 aH6UowBmmz1hsv2ufzuiyxw== X-Received: by 2002:a05:600c:4fd0:b0:3d1:c0a1:4804 with SMTP id o16-20020a05600c4fd000b003d1c0a14804mr4752783wmq.17.1670589432861; Fri, 09 Dec 2022 04:37:12 -0800 (PST) X-Google-Smtp-Source: AA0mqf5DyMiYpWNcqaQueb0cVh7tJ5lH4JY75MZjLcmrbwYgfM+x/au0sr5C4m2hvq8cZrZMVyWo5g== X-Received: by 2002:a05:600c:4fd0:b0:3d1:c0a1:4804 with SMTP id o16-20020a05600c4fd000b003d1c0a14804mr4752714wmq.17.1670589432518; Fri, 09 Dec 2022 04:37:12 -0800 (PST) Received: from gerbillo.redhat.com (146-241-106-22.dyn.eolo.it. [146.241.106.22]) by smtp.gmail.com with ESMTPSA id j10-20020a05600c1c0a00b003b49bd61b19sm9284355wms.15.2022.12.09.04.37.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 04:37:11 -0800 (PST) Message-ID: Subject: Re: [PATCH v1 2/3] Treewide: Stop corrupting socket's task_frag From: Paolo Abeni To: Benjamin Coddington , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Philipp Reisner , Lars Ellenberg , Christoph =?ISO-8859-1?Q?B=F6hmwalder?= , Jens Axboe , Josef Bacik , Keith Busch , Christoph Hellwig , Sagi Grimberg , Lee Duncan , Chris Leech , Mike Christie , "James E.J. Bottomley" , "Martin K. Petersen" , Valentina Manea , Shuah Khan , Greg Kroah-Hartman , David Howells , Marc Dionne , Steve French , Christine Caulfield , David Teigland , Mark Fasheh , Joel Becker , Joseph Qi , Eric Van Hensbergen , Latchesar Ionkov , Dominique Martinet , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Ilya Dryomov , Xiubo Li , Trond Myklebust , Anna Schumaker , Chuck Lever , Jeff Layton , drbd-dev@lists.linbit.com, linux-block@vger.kernel.org, nbd@other.debian.org, linux-nvme@lists.infradead.org, open-iscsi@googlegroups.com, linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, cluster-devel@redhat.com, ocfs2-devel@oss.oracle.com, v9fs-developer@lists.sourceforge.net, ceph-devel@vger.kernel.org, linux-nfs@vger.kernel.org Date: Fri, 09 Dec 2022 13:37:08 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org On Mon, 2022-11-21 at 08:35 -0500, Benjamin Coddington wrote: > Since moving to memalloc_nofs_save/restore, SUNRPC has stopped setting the > GFP_NOIO flag on sk_allocation which the networking system uses to decide > when it is safe to use current->task_frag. The results of this are > unexpected corruption in task_frag when SUNRPC is involved in memory > reclaim. > > The corruption can be seen in crashes, but the root cause is often > difficult to ascertain as a crashing machine's stack trace will have no > evidence of being near NFS or SUNRPC code. I believe this problem to > be much more pervasive than reports to the community may indicate. > > Fix this by having kernel users of sockets that may corrupt task_frag due > to reclaim set sk_use_task_frag = false. Preemptively correcting this > situation for users that still set sk_allocation allows them to convert to > memalloc_nofs_save/restore without the same unexpected corruptions that are > sure to follow, unlikely to show up in testing, and difficult to bisect. > > CC: Philipp Reisner > CC: Lars Ellenberg > CC: "Christoph Böhmwalder" > CC: Jens Axboe > CC: Josef Bacik > CC: Keith Busch > CC: Christoph Hellwig > CC: Sagi Grimberg > CC: Lee Duncan > CC: Chris Leech > CC: Mike Christie > CC: "James E.J. Bottomley" > CC: "Martin K. Petersen" > CC: Valentina Manea > CC: Shuah Khan > CC: Greg Kroah-Hartman > CC: David Howells > CC: Marc Dionne > CC: Steve French > CC: Christine Caulfield > CC: David Teigland > CC: Mark Fasheh > CC: Joel Becker > CC: Joseph Qi > CC: Eric Van Hensbergen > CC: Latchesar Ionkov > CC: Dominique Martinet > CC: "David S. Miller" > CC: Eric Dumazet > CC: Jakub Kicinski > CC: Paolo Abeni > CC: Ilya Dryomov > CC: Xiubo Li > CC: Chuck Lever > CC: Jeff Layton > CC: Trond Myklebust > CC: Anna Schumaker > CC: drbd-dev@lists.linbit.com > CC: linux-block@vger.kernel.org > CC: linux-kernel@vger.kernel.org > CC: nbd@other.debian.org > CC: linux-nvme@lists.infradead.org > CC: open-iscsi@googlegroups.com > CC: linux-scsi@vger.kernel.org > CC: linux-usb@vger.kernel.org > CC: linux-afs@lists.infradead.org > CC: linux-cifs@vger.kernel.org > CC: samba-technical@lists.samba.org > CC: cluster-devel@redhat.com > CC: ocfs2-devel@oss.oracle.com > CC: v9fs-developer@lists.sourceforge.net > CC: netdev@vger.kernel.org > CC: ceph-devel@vger.kernel.org > CC: linux-nfs@vger.kernel.org > > Suggested-by: Guillaume Nault > Signed-off-by: Benjamin Coddington I think this is the most feasible way out of the existing issue, and I think this patchset should go via the networking tree, targeting the Linux 6.2. If someone has disagreement with the above, please speak! Thanks, Paolo