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 E7668C433FE for ; Mon, 17 Oct 2022 09:49:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 13A076B0072; Mon, 17 Oct 2022 05:49:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0E9D76B0074; Mon, 17 Oct 2022 05:49:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ECBFA6B0075; Mon, 17 Oct 2022 05:49:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id D8D996B0072 for ; Mon, 17 Oct 2022 05:49:04 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 98AB4C0B35 for ; Mon, 17 Oct 2022 09:49:04 +0000 (UTC) X-FDA: 80029967808.22.B6A4249 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by imf17.hostedemail.com (Postfix) with ESMTP id 491EE40033 for ; Mon, 17 Oct 2022 09:49:03 +0000 (UTC) Received: by mail-pj1-f49.google.com with SMTP id gf8so10474502pjb.5 for ; Mon, 17 Oct 2022 02:49:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=wiNO2iX3w6Ebqf5hgxwoC6O28Jx095niafyH75mMHrI=; b=5z3Ma+XTzjMI+JItfQQcn270o1heB7RXNi7BZIXHmEafQSvh8SX105c4RQ7XMSSQmU 6AbNP3D+rnITcplb+TUktMna2d8BMYET4eWeLj1GQzZljJ9foV3LAd0AWBe/8xKPONYi zO34m+fmuDDesmWI0FhSc+5re79ZJgmd2lPQAMtX4dGphYEuTzaqEp+ULt8AbC5p9qgS L3mJBwe2XU3mhKYOjmdT9e2foMU7x3KF6cwtMISQ8CBGR5JsL0ym9TC6IacwzDsk/Q+Y bYvtKiLcGutGQ75YWlolse3qmnwva/LXbO/YgNBENmS4Ei41wv5siSw5A5cP6k4B4FYu 9bRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wiNO2iX3w6Ebqf5hgxwoC6O28Jx095niafyH75mMHrI=; b=4+gD5kbTQ2rS6++dODU8MsoHhJaCACQmMiQA8MqgFP0+gMPELjmIeI1ZsQToGK7DiC t80G7xqIouuT2el77q897UxqlCLMKjLgYwoJ0Hq7IAHm9ma/H9+BILU7b2Rq11rKR6SO bay+iS1xRx7dWosg/iC9dxMX9aAcXlbaR4Jj0wDn/b4g9Jm/0b3fTnKkjAWeDUCPnER0 Xzi6AtuybyEeaVG0i0OF5GtvZ9cUVWtp+o5Rk1J4RhT66ogAR4YA9SHHCI9eUPoCU40m Nv/sVyCp3v2BEbJeobNXTPMAs21Rd+xAo8SPaRHhQrsZPdznYEYsB/11kZ03O1R3yUpw ok2A== X-Gm-Message-State: ACrzQf0Ek4cBrqpO0YZv05GvT20VkkD2Wcp/yD59H9VNFXHo3OQjS21K Gor2Ol4zKYuXQkUOv4DifPzerFi+wstanbjL3S1s4w== X-Google-Smtp-Source: AMsMyM4jnANCd+NmgqUcAiPWiBfoXMuHaRQexECzurlEDbdLyekl/kxpsxBQHDF5VqOg0aS49ip8tGs4YIe0TxYZCaI= X-Received: by 2002:a17:90a:460d:b0:20c:1147:bf32 with SMTP id w13-20020a17090a460d00b0020c1147bf32mr31749482pjg.24.1666000141979; Mon, 17 Oct 2022 02:49:01 -0700 (PDT) MIME-Version: 1.0 References: <20221012081526.73067-1-huangjie.albert@bytedance.com> <2aaf2c3a-6e49-abb9-b9c8-19ce87404982@redhat.com> In-Reply-To: <2aaf2c3a-6e49-abb9-b9c8-19ce87404982@redhat.com> From: =?UTF-8?B?6buE5p2w?= Date: Mon, 17 Oct 2022 17:48:50 +0800 Message-ID: Subject: Re: [External] Re: [PATCH] mm: hugetlb: support get/set_policy for hugetlb_vm_ops To: David Hildenbrand Cc: songmuchun@bytedance.com, Mike Kravetz , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=5z3Ma+XT; spf=pass (imf17.hostedemail.com: domain of huangjie.albert@bytedance.com designates 209.85.216.49 as permitted sender) smtp.mailfrom=huangjie.albert@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666000144; a=rsa-sha256; cv=none; b=OmnUM8qFDyH2KteCstC22Lii0msqQJLT2zVVZw0pY39AbSxxKqrpxoXvPNvVDyxRc+Nccs 6P/TdIqIGtC2PzaA4EdUE2Qs8Vsw/M4SFsh8XTdzgWZrg8dwKHLVIMNzgey1pW0vmycDN3 tns43JHZSPvt5RUTKSS/BouoNVjXBCc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666000144; 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=wiNO2iX3w6Ebqf5hgxwoC6O28Jx095niafyH75mMHrI=; b=xsiiCew4Al8cVnxGHbWdjBUhv0vLGLuB2gego7naFYMeVtiaeibjXvnfF5sIlsB6HQBYcq k23Tc81rV4rSsJOQfktQxS771vidk5KalBY+MDoBg1kHeXH0fZTgOWcuvwsWUsulp9b0Kq rFSY938QU1ULzdYUSOHyU4UVrnHZqzc= X-Stat-Signature: 3eid5j4mmsaschsynoozyq4ihk8e4cxc X-Rspamd-Queue-Id: 491EE40033 Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=5z3Ma+XT; spf=pass (imf17.hostedemail.com: domain of huangjie.albert@bytedance.com designates 209.85.216.49 as permitted sender) smtp.mailfrom=huangjie.albert@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1666000143-211158 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: David Hildenbrand =E4=BA=8E2022=E5=B9=B410=E6=9C=8817=E6= =97=A5=E5=91=A8=E4=B8=80 16:44=E5=86=99=E9=81=93=EF=BC=9A > > 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. > Hi, David thanks for your reminder Yes, you are absolutely right, However, the pre-allocation mechanism does solve this problem. However, some scenarios do not like to use the pre-allocation mechanism, su= ch as scenarios that are sensitive to virtual machine startup time, or scenarios that require high memory utilization. The on-demand allocation mechanism may be better, so the key point is to find a way support for shared policy=E3=80=82 Thanks, Albert > -- > Thanks, > > David / dhildenb >