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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05E76C4321E for ; Mon, 17 Oct 2022 08:44:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6E7316B0072; Mon, 17 Oct 2022 04:44:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 697D16B0074; Mon, 17 Oct 2022 04:44:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 55F2E6B0075; Mon, 17 Oct 2022 04:44:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 476B56B0072 for ; Mon, 17 Oct 2022 04:44:14 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 1ACE516010B for ; Mon, 17 Oct 2022 08:44:14 +0000 (UTC) X-FDA: 80029804428.23.1AF1290 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf09.hostedemail.com (Postfix) with ESMTP id B6AFF14002C for ; Mon, 17 Oct 2022 08:44:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665996253; 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=A0G/s7FFc6fRx4eiRxxpQWaSRa2q0znsD4DR8qga7U0=; b=HDXa7qbvO5uVSdRmuob7DCil/VMETyS9WPGo01HfSVZTuL922vjKHbUPdjUvYRlhFv+9M6 B28PQT6IvMmFI2Uuqeex1Dzz6Zyqn49uUzesPHQ+3OqYxGO5WfIpFBHF6QMarpNvwgMO+2 ZW+Tt+bZD1QfoIC3I4Va6e9tIuOyKX8= 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-235-7KSj2pdaPe28JUwr9qzxPg-1; Mon, 17 Oct 2022 04:44:10 -0400 X-MC-Unique: 7KSj2pdaPe28JUwr9qzxPg-1 Received: by mail-wm1-f69.google.com with SMTP id v191-20020a1cacc8000000b003bdf7b78dccso7291199wme.3 for ; Mon, 17 Oct 2022 01:44:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=A0G/s7FFc6fRx4eiRxxpQWaSRa2q0znsD4DR8qga7U0=; b=CDO9L/Jb+dzwdzEaCVh5Ifd9h5Og7P0maWSw6wfUtQq4bbPTCKSJ5c53zr9pzST2WA OEaNZJgAMtSUftgNS51zRr2dd8dzj9XCV/Q6CgFTkNTY6xtLfdq0zxnUdePmpYSLr0ze F69moHFbmyH/Zwq3wEqb8l6zgfoFT2szaUpXomTGP5wvkibam4yGiVdTJI2K4uCOi0jV 5FR+THZeDH4/1qJZB+AV8ZwwDH0A5cXGDaAKr6MITygzdD9zAJ+UQ1OxuU2ps7tCKGxq Qyypb9I56cYaxLGfHFmUxFHnY/8p6np+1qqplE/KX562+7DThoQW8FDlNlE89Hwk8/IS faRA== X-Gm-Message-State: ACrzQf1cspyaSZ8ZU6QovbJPz46tbAQW4bQbTAD2a0XLmBzHT89NsYFA Yvd9TiAkFJ0Q0e3g88Q+Ce2oUF4R8cLjjsxIWNh3KlU3NVr1z/K7qxvmsyK/0Bn1yjlwJRzvqS2 Z6iDPFCbSnc4= X-Received: by 2002:a5d:4a4e:0:b0:22e:64a6:7a52 with SMTP id v14-20020a5d4a4e000000b0022e64a67a52mr5472545wrs.333.1665996249426; Mon, 17 Oct 2022 01:44:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM61xdkOYp/u8H5U4i9P8jb5eYC8/ZeaBJJSV+HbkCVx665ScinUC4TK7sZT/C3i79ODpATzSA== X-Received: by 2002:a5d:4a4e:0:b0:22e:64a6:7a52 with SMTP id v14-20020a5d4a4e000000b0022e64a67a52mr5472528wrs.333.1665996249163; Mon, 17 Oct 2022 01:44:09 -0700 (PDT) Received: from ?IPV6:2003:cb:c707:2300:e5ce:21ba:1d93:4323? (p200300cbc7072300e5ce21ba1d934323.dip0.t-ipconnect.de. [2003:cb:c707:2300:e5ce:21ba:1d93:4323]) by smtp.gmail.com with ESMTPSA id z10-20020a05600c0a0a00b003a2f2bb72d5sm20496939wmp.45.2022.10.17.01.44.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Oct 2022 01:44:08 -0700 (PDT) Message-ID: <2aaf2c3a-6e49-abb9-b9c8-19ce87404982@redhat.com> Date: Mon, 17 Oct 2022 10:44:07 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH] mm: hugetlb: support get/set_policy for hugetlb_vm_ops To: Albert Huang , songmuchun@bytedance.com Cc: Mike Kravetz , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20221012081526.73067-1-huangjie.albert@bytedance.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20221012081526.73067-1-huangjie.albert@bytedance.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=HDXa7qbv; spf=pass (imf09.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1665996253; a=rsa-sha256; cv=none; b=cVm4GuaU99YC1PqqScnUvxRMaJJPtJ7oUDQsvg29sOF+/dKqB6cnqM+ta559Gj9Defmw/k YlF9ed5nrYvtTksBvt6C/Dr21Jc2enOHM8I68iGs5EhisWB2vX5tqIlnfo4iz0Vl0eOgWI L6xfm9xZkVCY5Iy7XREpIEVHlbDZArE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1665996253; h=from:from:sender: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:dkim-signature; bh=A0G/s7FFc6fRx4eiRxxpQWaSRa2q0znsD4DR8qga7U0=; b=4PMUJjLdvO7gISR0J9tVHhks+ENk/lHPROHAXny7dbL55HPH9KcOKzCRxP6eMLT3Zk4Yy0 kUV3ZxbfWd92KfPsnex3hsw6i9B+e7EBSkUzfbpa/PcqTGHl1k8g1hB72XOVjhIwYb8h9p j5wmbzx52Crb3P19+6b3T5re3WQNtQA= X-Stat-Signature: ambusku9xmf3t8x1houjbeqaffr861ek X-Rspamd-Queue-Id: B6AFF14002C Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=HDXa7qbv; spf=pass (imf09.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1665996253-329594 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 12.10.22 10:15, Albert Huang wrote: > From: "huangjie.albert" > > implement these two functions so that we can set the mempolicy to > the inode of the hugetlb file. This ensures that the mempolicy of > all processes sharing this huge page file is consistent. > > In some scenarios where huge pages are shared: > if we need to limit the memory usage of vm within node0, so I set qemu's > mempilciy bind to node0, but if there is a process (such as virtiofsd) > shared memory with the vm, in this case. If the page fault is triggered > by virtiofsd, the allocated memory may go to node1 which depends on > virtiofsd. > Any VM that uses hugetlb should be preallocating memory. For example, this is the expected default under QEMU when using huge pages. Once preallocation does the right thing regarding NUMA policy, there is no need to worry about it in other sub-processes. -- Thanks, David / dhildenb