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 B1A45C001DC for ; Mon, 31 Jul 2023 16:02:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233045AbjGaQCw (ORCPT ); Mon, 31 Jul 2023 12:02:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233036AbjGaQCs (ORCPT ); Mon, 31 Jul 2023 12:02:48 -0400 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 8C0C3172D for ; Mon, 31 Jul 2023 09:02:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690819323; 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: in-reply-to:in-reply-to:references:references; bh=fle66BdI0bujJwN3hEl5LFW6syixCYXJ4Ddx7BkUR20=; b=FjFPNpwRpeoDQHDYVCo2wxwZ/i1i45o3vcMdOq4Lq6rDqoKS9LMiJ5DYiDIToL47cOLYDZ OIUOMAzVw7313cYiLqoK+cPsnnm9FfiqSP7USST2/Xv0vVXkMU8Cb2ULd4a9G0L+IuwXhY UcQroxULKyTMubScLi7XbO471iYGnDo= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-127-o14YiRo5OJef-7Y8605kMA-1; Mon, 31 Jul 2023 12:02:01 -0400 X-MC-Unique: o14YiRo5OJef-7Y8605kMA-1 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-76ca562d510so31587985a.1 for ; Mon, 31 Jul 2023 09:02:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690819321; x=1691424121; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=fle66BdI0bujJwN3hEl5LFW6syixCYXJ4Ddx7BkUR20=; b=H7eW6ReN7gZFOci81DQHg6VvZ6OpQZ1DLjM/3FqfZUBd602MO9GOgs2cBhFL/9UZ4R ztL8k6+2B4YxX+g4OdgV3kPWWlzLLXdca1AVCHtdF6PrJbMITZjFib4ohzDD9PiudiPW 6njkv7q+YPHGLW8vP93VGQwWD1O7tIKFEhdv5egjxTiW7WYe5ZWkgYiRT+ezLt3fMNps EfjFA+l/n08y6DEHtNrqIjR7ZotDiRbL/eoEkz6m0LmN5iCXcIGIs+QSfEUNnGgci+l8 ECwVSdEe1aEdzH4KbWaLS9hj1MaIfEIgRWN867bGiMUxfDCKHtxzDEwX8LNm5G6pTZO7 QY1A== X-Gm-Message-State: ABy/qLasg2dmDSbcZo5jLeugYhVJpxYlZvVOolxNb0GB+tMAnZLEDAIv L2N+JrZ8ZyZq0tAkYE4n8dp9cudoguD0gwmDFftTAiI7rfEl9fa1mLaZ2+TtC35sFdmsrrMiesC mCo+G3MoCOWlXq5RCBqTpz8FVfQ== X-Received: by 2002:a05:620a:bd5:b0:76a:f689:dff2 with SMTP id s21-20020a05620a0bd500b0076af689dff2mr8009928qki.7.1690819321166; Mon, 31 Jul 2023 09:02:01 -0700 (PDT) X-Google-Smtp-Source: APBJJlHmDU3Q7e8CyjbeT0B4NsylAZwm9By0RZ0H8bJsJ1dfXWvcoMjORe9NZsY46jRpEjqXmqkdAw== X-Received: by 2002:a05:620a:bd5:b0:76a:f689:dff2 with SMTP id s21-20020a05620a0bd500b0076af689dff2mr8009895qki.7.1690819320764; Mon, 31 Jul 2023 09:02:00 -0700 (PDT) Received: from x1n (cpe5c7695f3aee0-cm5c7695f3aede.cpe.net.cable.rogers.com. [99.254.144.39]) by smtp.gmail.com with ESMTPSA id j27-20020a05620a001b00b00767d05117fesm3391474qki.36.2023.07.31.09.01.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 09:02:00 -0700 (PDT) Date: Mon, 31 Jul 2023 12:01:58 -0400 From: Peter Xu To: Jason Gunthorpe Cc: David Hildenbrand , Linus Torvalds , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Andrew Morton , liubo , Matthew Wilcox , Hugh Dickins , John Hubbard Subject: Re: [PATCH v1 0/4] smaps / mm/gup: fix gup_can_follow_protnone fallout Message-ID: References: <20230727212845.135673-1-david@redhat.com> <69a5f457-63b6-2d4f-e5c0-4b3de1e6c9f1@redhat.com> <22262495-c92c-20fa-dddf-eee4ce635b12@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Fri, Jul 28, 2023 at 07:14:26PM -0300, Jason Gunthorpe wrote: > On Fri, Jul 28, 2023 at 11:31:49PM +0200, David Hildenbrand wrote: > > * vfio triggers FOLL_PIN|FOLL_LONGTERM from a random QEMU thread. > > Where should we migrate that page to? Would it actually be counter- > > productive to migrate it to the NUMA node of the setup thread? The > > longterm pin will turn the page unmovable, yes, but where to migrate > > it to? > > For VFIO & KVM you actively don't get any kind of numa balancing or > awareness. In this case qemu should probably strive to put the memory > on the numa node of the majorty of CPUs early on because it doesn't > get another shot at it. > > In other cases it depends quite alot. Eg DPDK might want its VFIO > buffers to NUMA'd to the node that is close to the device, not the > CPU. Or vice versa. There is alot of micro sensitivity here at high > data rates. I think people today manually tune this by deliberately > allocating the memory to specific numas and then GUP should just leave > it alone. Right. For the other O_DIRECT example - it seems to be a more generic issue to "whether we should rely on the follow up accessor to decide the target node of numa balancing". To me at least for KVM's use case I'd still expect the major paths to trigger that is still when guest accessing a page from vcpu threads, that's still the GUP paths. Thanks, -- Peter Xu