Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp1225762pxb; Wed, 16 Feb 2022 14:03:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJxk1u3iAgCW8LtWN3rKWBd8I+HjAAJNZs1sogRH26qUhAPuuvIyeMkNKyaGQUbqeFq+EKKr X-Received: by 2002:a63:1c14:0:b0:36b:28ef:f8ce with SMTP id c20-20020a631c14000000b0036b28eff8cemr21021pgc.96.1645049009471; Wed, 16 Feb 2022 14:03:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645049009; cv=none; d=google.com; s=arc-20160816; b=pRsvyl6vEIbpJ57SP8TI0HIGmq+yJRU+tATcuz3T6I8SDuzcFaQRFVNqhDjL+lhp3M aK+c2E+0FrnO+0nMKcFwehHQnlWOCr5ZGkUVWAky7ADJ89Dl8iNrj+UhKZ5Q7BSWuwL8 Q4LyCrXu3/TElSTjPmbYEM0iCzYsWrL0BPOtSR6jqq9tCn4ohNJLCUj43saGA0n6rzKl MSsanIX3r+x+SdOKm+Vhw66m4kTZPXcA1tUricqJW7JwoqRDTc+MmkTakQn+55P3Np+l qkuWPKpQzB0u0mjDHK2YTT0b1M4y3rY4kI+MonGridMa6juWz4UFAqG6Ikee9gxEhTLy Z2ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=qWwICwWiIF40xZ+Zq3BsYS9POJkYNqaJwZ0kpBHyi5A=; b=f2/2Ha8CmjHjssVMiLBABeM0/juM1resB0TTIy5ynaiSmw59EWY4+hKdJzhWP6+uBi d2ZYJwYgTYeNAY1uRrcQRmhe+tAOkgB+F/uRtykJNaERl8vhFRSOUKaYomh/nxedLaQc 4MKCfdZG+fJrRCBgnN3wz/OgJtTVpv/5V+VBCwLgsaRT2STcWQzuwKxEhxPGCJCbCCSE v0GZcvYGIDAwQGK+5wNMeSk8/rqXJbAJxI+okShp2+qntH7sp0jQinTYghhxcZLOYNsx CxF14CUpxpqX024GzVRWFUdLNf7yWq56rv9kiClwP1Ncfci0HB1N3zemlKonQYD3JV2i gjLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=toYpoJDy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lr2si148746pjb.95.2022.02.16.14.03.11; Wed, 16 Feb 2022 14:03:29 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=toYpoJDy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238096AbiBPTVd (ORCPT + 99 others); Wed, 16 Feb 2022 14:21:33 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:45778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238087AbiBPTVc (ORCPT ); Wed, 16 Feb 2022 14:21:32 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 906F3297237 for ; Wed, 16 Feb 2022 11:21:19 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 38892B81D1B for ; Wed, 16 Feb 2022 19:21:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBF50C340F0 for ; Wed, 16 Feb 2022 19:21:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645039276; bh=xVJhQv2N+t/b1QKR6ESSmdKPDVDMHh6xIUIeUWMzHo0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=toYpoJDywqdTkLDDy7vsY6xa9ls8AOIUEgpr6qH81qjMtO7v6QaZM1cpfGW83mBlw 70VkkBHZh1CumykZN6a01HtkAkRtYplWDOg84fU4+GRN/1TV1MnmzLWyKCb/z2C6q3 SQqeiC9uJFtg3WxKCMZ6eDl5KfO4vfSMSqo6wkkTtzENgOBWsrHzEe4gUFRl6PmoNY BLRX7uvKIOS0PJOScQWd1xvINwCcV8Ll4F+6Z7pQGi1tO89hZVhJTpnc+trxIjYSm9 3bG1Wn3SriEKM6JCff120hzcAl5Mr5srX+V4RFgCNgGeFURzijxRWfoVzoi8Hb4CfQ O0IbQ1jqlOokg== Received: by mail-yw1-f172.google.com with SMTP id 00721157ae682-2d07ae0b1bfso9681047b3.6 for ; Wed, 16 Feb 2022 11:21:16 -0800 (PST) X-Gm-Message-State: AOAM531y8WLTyqr9xmZIlURgxwsg5k1G7ZKw8xkCNAq7qN+pBJFkgbzd Cpz+HZ4S/a3lv6ziUXZ33CRJIHm/CpR3/QIcH9E= X-Received: by 2002:a81:5354:0:b0:2ca:287c:6b5e with SMTP id h81-20020a815354000000b002ca287c6b5emr3833390ywb.3.1645039275845; Wed, 16 Feb 2022 11:21:15 -0800 (PST) MIME-Version: 1.0 References: <20200917112538.GD8409@ziepe.ca> <20200917193824.GL8409@ziepe.ca> <20200918164032.GA5962@xz-x1> <20200918173240.GY8409@ziepe.ca> <20200918204048.GC5962@xz-x1> <0af8c77e-ff60-cada-7d22-c7cfcf859b19@nvidia.com> <20200919000153.GZ8409@ziepe.ca> <20200921083505.GA5862@quack2.suse.cz> <20200921120301.GD8409@ziepe.ca> In-Reply-To: From: Oded Gabbay Date: Wed, 16 Feb 2022 21:20:49 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/4] mm: Trial do_wp_page() simplification To: Linus Torvalds Cc: David Hildenbrand , Jason Gunthorpe , Jan Kara , John Hubbard , Leon Romanovsky , Linux-MM , Linux Kernel Mailing List , "Maya B . Gokhale" , Yang Shi , Marty Mcfadden , Kirill Shutemov , Oleg Nesterov , Jann Horn , Kirill Tkhai , Andrea Arcangeli , Christoph Hellwig , Andrew Morton , Daniel Vetter , Greg Kroah-Hartman , Peter Xu , dave@sr71.net Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 16, 2022 at 9:04 PM Linus Torvalds wrote: > > [ Added David Hildenbrand to the participants. David, see > > https://bugzilla.kernel.org/show_bug.cgi?id=215616 > > for details ] > > On Wed, Feb 16, 2022 at 8:59 AM Oded Gabbay wrote: > > > > All the details are in the bug, but the bottom line is that somehow, > > this patch causes corruption when the numa balancing feature is > > enabled AND we don't use process affinity AND we use GUP to pin pages > > so our accelerator can DMA to/from system memory. > > Hmm. I thought all the remaining issues were related to THP - and > David Hildenbrand had a series to fix those up. > > The fact that it also shows up with numa balancing is a bit > unfortunate, because I think that means that that patch series may not > have caught that case. > > That said - what does "we use GUP to pin pages" mean? Does it actually > use the pinning logic, or just regular old GUP? > > I'm assuming this is just the existing pin_user_pages_fast() (ie a > proper pin) in drivers/misc/habanalabs/common/memory.c. But I wanted > to confirm that it's not some other situation. > > Linus > [Adding dave hansen as we chatted about it in irc] It uses the pinning logic, simply calling pin_user_pages_fast with the relevant gup flags to pin the userspace memory so we can after that dma map it and give the bus address to the h/w. And afaik, the gup flags combination we use (FOLL_FORCE | FOLL_WRITE | FOLL_LONGTERM) is the correct combination, at least according to the last time it was discussed with Daniel, Jason and other people. Oded