Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2035462pxb; Thu, 11 Feb 2021 02:35:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJyevwHE3lHjYuCGsq0Gz27NC3xgDSsGKmagcAMWQ2YOiUSrEhXXqAINe0OB7ZYFOw0IEPdQ X-Received: by 2002:a17:906:805:: with SMTP id e5mr7846848ejd.104.1613039750326; Thu, 11 Feb 2021 02:35:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613039750; cv=none; d=google.com; s=arc-20160816; b=CCr8mwa7PXsaAEkxQt0JuGzjYPUS1fzd2voPoeHk08/R5XRnYz3Fa+vRziwS2cdX11 rc3ikC7tTTJKQo4bHDuFRW1zVv4cp8EPy7EnzSpUUr2/5f335JJkqDLyl/AcT9biSXic Q5Rvy/nWA1oHMPDXaAhuiFWvub2Iu1AoTGmykH2h8hEVPXZRbq3zWsh0kE9MRiAxIn4W E5wYo9uBzFknLtCF8n69j+whI7FE7BCtNQ8VkkygOtnJv0CvqhfmxunneUHfdse+KmIm xhwMk8U+nO3rKVfzSvQthsMSVl44KVHsNq0GSZT9IouSdT0wC9Iz1LyLhiowhKMgUoKP GRxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject :organization:from:references:cc:to:dkim-signature; bh=uy1irgQ/ZwVow/3hF7bCH/moHa6j8udykjKdWqM+w4w=; b=OmzDc9dPkW7ynLu33rGeKyBicYlwr9xk0XqIBCgWM8DLsCVicDAbFKtQ51iTksSNDu tiBpvrHmMXK8eMoluNLy6ebVvScuYNxmIojswiyqwfTCyrvnnErUl76KVL8UzHjskaBF rij881oFIIh8fk6OErnXjAPJSb3URwLvUhpPcxLPSc1UjfzdvmbiJQ9+4xkyGVIsaOV2 QsPlnFQvzG5kyD/HHQdK6+ZLNoXvbKNa70B89b2KahCfdk9RFdPFpHb/8Km8RiKEdOLf bD9LT+pGVMDFsOAW4ly4FhM+htxteAVTLwQS/HYE2ONTwc7Dn0IWLKwyTiX1s23eteQ4 Z7bQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MXByMtlN; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s9si3532198ejv.221.2021.02.11.02.35.26; Thu, 11 Feb 2021 02:35:50 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=MXByMtlN; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230213AbhBKKcu (ORCPT + 99 others); Thu, 11 Feb 2021 05:32:50 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:27562 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229928AbhBKKaf (ORCPT ); Thu, 11 Feb 2021 05:30:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613039344; 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=uy1irgQ/ZwVow/3hF7bCH/moHa6j8udykjKdWqM+w4w=; b=MXByMtlNQth5K6gWLRzwyBrxRTTfxIuFefimLfDvVZu9ZTw5E/rNszSGl2Ywkes+iSvvei j1+KqBpT2VKSPDBFEC0tF1yF+kiSLtGZOB5s0wlEQjSoIFnB95nvv5NjdycA3c2EJfra7G qYbByPMMNzOlEZa+rqDQRjF1K8RkLus= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-343-tBokRLcyOCuiMXeuiZATSA-1; Thu, 11 Feb 2021 05:29:02 -0500 X-MC-Unique: tBokRLcyOCuiMXeuiZATSA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CA09FC7401; Thu, 11 Feb 2021 10:28:59 +0000 (UTC) Received: from [10.36.114.52] (ovpn-114-52.ams2.redhat.com [10.36.114.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id 61FF96268D; Thu, 11 Feb 2021 10:28:53 +0000 (UTC) To: "Song Bao Hua (Barry Song)" , Jason Gunthorpe Cc: "Wangzhou (B)" , "linux-kernel@vger.kernel.org" , "iommu@lists.linux-foundation.org" , "linux-mm@kvack.org" , "linux-arm-kernel@lists.infradead.org" , "linux-api@vger.kernel.org" , Andrew Morton , Alexander Viro , "gregkh@linuxfoundation.org" , "kevin.tian@intel.com" , "jean-philippe@linaro.org" , "eric.auger@redhat.com" , "Liguozhu (Kenneth)" , "zhangfei.gao@linaro.org" , "chensihang (A)" References: <1612685884-19514-1-git-send-email-wangzhou1@hisilicon.com> <1612685884-19514-2-git-send-email-wangzhou1@hisilicon.com> <20210208183348.GV4718@ziepe.ca> <0dca000a6cd34d8183062466ba7d6eaf@hisilicon.com> <20210208213023.GZ4718@ziepe.ca> <0868d209d7424942a46d1238674cf75d@hisilicon.com> <20210209135331.GF4718@ziepe.ca> <2527b4ac8df14fa1b427bef65dace719@hisilicon.com> <20210210180405.GP4718@ziepe.ca> <8a676b45ebaa49e8886f4bf9b762bb75@hisilicon.com> From: David Hildenbrand Organization: Red Hat GmbH Subject: Re: [RFC PATCH v3 1/2] mempinfd: Add new syscall to provide memory pin Message-ID: Date: Thu, 11 Feb 2021 11:28:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <8a676b45ebaa49e8886f4bf9b762bb75@hisilicon.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> >> Again in proper SVA it should be quite unlikely to take a fault caused >> by something like migration, on the same likelyhood as the CPU. If >> things are faulting so much this is a problem then I think it is a >> system level problem with doing too much page motion. > > My point is that single one SVA application shouldn't require system > to make global changes, such as disabling numa balancing, disabling > THP, to decrease page fault frequency by affecting other applications. > > Anyway, guys are in lunar new year. Hopefully, we are getting more > real benchmark data afterwards to make the discussion more targeted. Right, but I think functionality as proposed in this patch is highly unlikely to make it into the kernel. I'd be interested in approaches to mitigate this per process. E.g., temporarily stop the kernel from messing with THP of this specific process. But even then, why should some random library make such decisions for a whole process? Just as, why should some random library pin pages never allocated by it and stop THP from being created or NUMA layout from getting optimized? This looks like a clear layer violation to me. I fully agree with Jason: Why do the events happen that often such that your use cases are affected that heavily, such that we even need such ugly handling? What mempinfd does is exposing dangerous functionality that we don't want 99.99996% of all user space to ever use via a syscall to generic users to fix broken* hw. *broken might be over-stressing the situation, but the HW (SVA) obviously seems to perform way worse than ordinary CPUs. -- Thanks, David / dhildenb