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 59707D5C0C7 for ; Sat, 9 Nov 2024 03:43:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C00BD6B009E; Fri, 8 Nov 2024 22:43:38 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BB1346B009F; Fri, 8 Nov 2024 22:43:38 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A50D86B00A0; Fri, 8 Nov 2024 22:43:38 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 826706B009E for ; Fri, 8 Nov 2024 22:43:38 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 0329680F53 for ; Sat, 9 Nov 2024 03:43:37 +0000 (UTC) X-FDA: 82765161192.15.90E6EC3 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) by imf10.hostedemail.com (Postfix) with ESMTP id 978A0C0007 for ; Sat, 9 Nov 2024 03:43:18 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=aeMwwNtb; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf10.hostedemail.com: domain of lkp@intel.com designates 198.175.65.17 as permitted sender) smtp.mailfrom=lkp@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731123690; a=rsa-sha256; cv=none; b=xNuFLRyySqw/6Fqs+nlX6Jc8WoIgXmDHR0jMAXAQddKMLz22tSJmYVPuXYBVxLPmTPSH0y 2KHw/BhEK+LRCdbrmZBNI7f4mOadox9t67054twd2GvGQt4xmequS87ApwMAAcl0slYt+M Bh68jdl49WfuJqa96TKYj09vJVJbEI0= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=aeMwwNtb; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf10.hostedemail.com: domain of lkp@intel.com designates 198.175.65.17 as permitted sender) smtp.mailfrom=lkp@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1731123690; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Js+NdBgvfYKYL7WRSXJMclc32dTafeTvwTSTZVm9WO0=; b=X2R9GYxlxsemZOCPUAqOznTZpPf5Hq0LiG4U6ps3iuuXpJy5/RgAZ43HBD+Zmcghfhmex7 qgRzWqA/sp/sa4Nj/P/+zjWa6r7jo9rZPyN2Do6T58Y3PpoWRK4Nj/R/HKC7NbLLIWWYwk 4V3p07SZmEiUV7+JERBO8Vwhbay+nu4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1731123816; x=1762659816; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Y8gRkvKe4SZgufdVa38PVa6F32tIaLfPt8fCTz17p8c=; b=aeMwwNtbwviZ/I/z/V8X6FDMbNyi2dRj3gKY9coq73zHFLvRldCmD1fs H0z1D3I97yZA7oT5lAGnVmW9Dy4D5yab3ndjU90D1YbJXlb0tgP6X0lXf vMVg9oitUSLN42dnFYMGa4ABtHwhg9voMEiCy0gsiQMCjQTpePJruHwR4 WfA56ULIPxi69kcXheUJTvks5PZEwRuFHHOQOBlHAwyl3Rg0kdwdbU3+9 RjFxZK8Px+gAxE0Pn7O+mVMJtN1LrsH6rz5Cmam2QPU2gAFyJAlnSgYfG p0DQxX3vu2olxPAtEdMUHx/jD9K3rUEmuCMP22fCP6NYmMgY5jYCrOuDd A==; X-CSE-ConnectionGUID: rwAhCc4dSIiX42mEUFiZDw== X-CSE-MsgGUID: jooPLgMyRGa4Rzy7CalgmQ== X-IronPort-AV: E=McAfee;i="6700,10204,11250"; a="31119803" X-IronPort-AV: E=Sophos;i="6.12,139,1728975600"; d="scan'208";a="31119803" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2024 19:43:34 -0800 X-CSE-ConnectionGUID: DQEC6TZSTMOTmE2o2Y8U8w== X-CSE-MsgGUID: ncml/TeXT0KH3hsYQspbEw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,139,1728975600"; d="scan'208";a="90956920" Received: from lkp-server01.sh.intel.com (HELO a48cf1aa22e8) ([10.239.97.150]) by orviesa004.jf.intel.com with ESMTP; 08 Nov 2024 19:43:30 -0800 Received: from kbuild by a48cf1aa22e8 with local (Exim 4.96) (envelope-from ) id 1t9cNk-000s2w-0i; Sat, 09 Nov 2024 03:43:28 +0000 Date: Sat, 9 Nov 2024 11:42:43 +0800 From: kernel test robot To: Joshua Hahn , shakeel.butt@linux.dev Cc: oe-kbuild-all@lists.linux.dev, hannes@cmpxchg.org, mhocko@kernel.org, roman.gushchin@linux.dev, muchun.song@linux.dev, akpm@linux-foundation.org, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: Re: [PATCH 2/3] memcg/hugetlb: Introduce mem_cgroup_charge_hugetlb Message-ID: <202411091159.y6yDCkdf-lkp@intel.com> References: <20241108212946.2642085-3-joshua.hahnjy@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241108212946.2642085-3-joshua.hahnjy@gmail.com> X-Rspamd-Queue-Id: 978A0C0007 X-Stat-Signature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hjDaSB6r3gzKo8Av0xtEZ0KrE8aeiF6GwLSgudwIA4irXCharZfKzJ5jsa9D8IaqyIGDub0/YXk9aTvMQHxvKLg6mQPLAk7Ahox8mWQUSDfBBdDwHO/Tnr0oeMU2ZTm2zDSg1MZUlTqFyjHp0ckgvBEhH0RajaXVe8kX09t7Rzqm8q1bP24o2vmEQg50wxaHDE4z71Zedfb2I3SzCfJMLUL31T9ylIZTYlfkjea79QJdk0AEVqP1IhqP3bouR5ztdtGrK8WFn2Nd56yvwtiiHamI1Wfo++Xjf9pYN26qRULFR1oyG0uBp37MeNgi6KZw6rR3XMbVioloMLf57CL82f05+p2K9PoBsmWjAadR3MRZkE8cNkPAv1soMmZ1SW8GwcugWMtrD+RJ6O9huLMGVPnBUOM1WngMW3aaK1tq0U7kRaXd0R7cEwYa0oPiQv5fbbgtnAT5MJ+ASaMst66lBxLCns6TBwGT9qOpn8eNTgrlNmzo2bKWjA== 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: List-Subscribe: List-Unsubscribe: Hi Joshua, kernel test robot noticed the following build errors: [auto build test ERROR on akpm-mm/mm-everything] [also build test ERROR on next-20241108] [cannot apply to linus/master v6.12-rc6] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Joshua-Hahn/memcg-hugetlb-Introduce-memcg_accounts_hugetlb/20241109-053045 base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything patch link: https://lore.kernel.org/r/20241108212946.2642085-3-joshua.hahnjy%40gmail.com patch subject: [PATCH 2/3] memcg/hugetlb: Introduce mem_cgroup_charge_hugetlb config: x86_64-defconfig (https://download.01.org/0day-ci/archive/20241109/202411091159.y6yDCkdf-lkp@intel.com/config) compiler: gcc-11 (Debian 11.3.0-12) 11.3.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241109/202411091159.y6yDCkdf-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202411091159.y6yDCkdf-lkp@intel.com/ All errors (new ones prefixed by >>): mm/hugetlb.c: In function 'alloc_hugetlb_folio': >> mm/hugetlb.c:3083:15: error: implicit declaration of function 'mem_cgroup_charge_hugetlb'; did you mean 'mem_cgroup_charge_skmem'? [-Werror=implicit-function-declaration] 3083 | ret = mem_cgroup_charge_hugetlb(folio, gfp); | ^~~~~~~~~~~~~~~~~~~~~~~~~ | mem_cgroup_charge_skmem cc1: some warnings being treated as errors vim +3083 mm/hugetlb.c 2963 2964 struct folio *alloc_hugetlb_folio(struct vm_area_struct *vma, 2965 unsigned long addr, int avoid_reserve) 2966 { 2967 struct hugepage_subpool *spool = subpool_vma(vma); 2968 struct hstate *h = hstate_vma(vma); 2969 struct folio *folio; 2970 long map_chg, map_commit; 2971 long gbl_chg; 2972 int ret, idx; 2973 struct hugetlb_cgroup *h_cg = NULL; 2974 bool deferred_reserve; 2975 gfp_t gfp = htlb_alloc_mask(h) | __GFP_RETRY_MAYFAIL; 2976 2977 idx = hstate_index(h); 2978 /* 2979 * Examine the region/reserve map to determine if the process 2980 * has a reservation for the page to be allocated. A return 2981 * code of zero indicates a reservation exists (no change). 2982 */ 2983 map_chg = gbl_chg = vma_needs_reservation(h, vma, addr); 2984 if (map_chg < 0) 2985 return ERR_PTR(-ENOMEM); 2986 2987 /* 2988 * Processes that did not create the mapping will have no 2989 * reserves as indicated by the region/reserve map. Check 2990 * that the allocation will not exceed the subpool limit. 2991 * Allocations for MAP_NORESERVE mappings also need to be 2992 * checked against any subpool limit. 2993 */ 2994 if (map_chg || avoid_reserve) { 2995 gbl_chg = hugepage_subpool_get_pages(spool, 1); 2996 if (gbl_chg < 0) 2997 goto out_end_reservation; 2998 2999 /* 3000 * Even though there was no reservation in the region/reserve 3001 * map, there could be reservations associated with the 3002 * subpool that can be used. This would be indicated if the 3003 * return value of hugepage_subpool_get_pages() is zero. 3004 * However, if avoid_reserve is specified we still avoid even 3005 * the subpool reservations. 3006 */ 3007 if (avoid_reserve) 3008 gbl_chg = 1; 3009 } 3010 3011 /* If this allocation is not consuming a reservation, charge it now. 3012 */ 3013 deferred_reserve = map_chg || avoid_reserve; 3014 if (deferred_reserve) { 3015 ret = hugetlb_cgroup_charge_cgroup_rsvd( 3016 idx, pages_per_huge_page(h), &h_cg); 3017 if (ret) 3018 goto out_subpool_put; 3019 } 3020 3021 ret = hugetlb_cgroup_charge_cgroup(idx, pages_per_huge_page(h), &h_cg); 3022 if (ret) 3023 goto out_uncharge_cgroup_reservation; 3024 3025 spin_lock_irq(&hugetlb_lock); 3026 /* 3027 * glb_chg is passed to indicate whether or not a page must be taken 3028 * from the global free pool (global change). gbl_chg == 0 indicates 3029 * a reservation exists for the allocation. 3030 */ 3031 folio = dequeue_hugetlb_folio_vma(h, vma, addr, avoid_reserve, gbl_chg); 3032 if (!folio) { 3033 spin_unlock_irq(&hugetlb_lock); 3034 folio = alloc_buddy_hugetlb_folio_with_mpol(h, vma, addr); 3035 if (!folio) 3036 goto out_uncharge_cgroup; 3037 spin_lock_irq(&hugetlb_lock); 3038 if (!avoid_reserve && vma_has_reserves(vma, gbl_chg)) { 3039 folio_set_hugetlb_restore_reserve(folio); 3040 h->resv_huge_pages--; 3041 } 3042 list_add(&folio->lru, &h->hugepage_activelist); 3043 folio_ref_unfreeze(folio, 1); 3044 /* Fall through */ 3045 } 3046 3047 hugetlb_cgroup_commit_charge(idx, pages_per_huge_page(h), h_cg, folio); 3048 /* If allocation is not consuming a reservation, also store the 3049 * hugetlb_cgroup pointer on the page. 3050 */ 3051 if (deferred_reserve) { 3052 hugetlb_cgroup_commit_charge_rsvd(idx, pages_per_huge_page(h), 3053 h_cg, folio); 3054 } 3055 3056 spin_unlock_irq(&hugetlb_lock); 3057 3058 hugetlb_set_folio_subpool(folio, spool); 3059 3060 map_commit = vma_commit_reservation(h, vma, addr); 3061 if (unlikely(map_chg > map_commit)) { 3062 /* 3063 * The page was added to the reservation map between 3064 * vma_needs_reservation and vma_commit_reservation. 3065 * This indicates a race with hugetlb_reserve_pages. 3066 * Adjust for the subpool count incremented above AND 3067 * in hugetlb_reserve_pages for the same page. Also, 3068 * the reservation count added in hugetlb_reserve_pages 3069 * no longer applies. 3070 */ 3071 long rsv_adjust; 3072 3073 rsv_adjust = hugepage_subpool_put_pages(spool, 1); 3074 hugetlb_acct_memory(h, -rsv_adjust); 3075 if (deferred_reserve) { 3076 spin_lock_irq(&hugetlb_lock); 3077 hugetlb_cgroup_uncharge_folio_rsvd(hstate_index(h), 3078 pages_per_huge_page(h), folio); 3079 spin_unlock_irq(&hugetlb_lock); 3080 } 3081 } 3082 > 3083 ret = mem_cgroup_charge_hugetlb(folio, gfp); 3084 if (ret == -ENOMEM) { 3085 spin_unlock_irq(&hugetlb_lock); 3086 free_huge_folio(folio); 3087 return ERR_PTR(-ENOMEM); 3088 } 3089 else if (!ret) 3090 lruvec_stat_mod_folio(folio, NR_HUGETLB, 3091 pages_per_huge_page(h)); 3092 3093 return folio; 3094 3095 out_uncharge_cgroup: 3096 hugetlb_cgroup_uncharge_cgroup(idx, pages_per_huge_page(h), h_cg); 3097 out_uncharge_cgroup_reservation: 3098 if (deferred_reserve) 3099 hugetlb_cgroup_uncharge_cgroup_rsvd(idx, pages_per_huge_page(h), 3100 h_cg); 3101 out_subpool_put: 3102 if (map_chg || avoid_reserve) 3103 hugepage_subpool_put_pages(spool, 1); 3104 out_end_reservation: 3105 vma_end_reservation(h, vma, addr); 3106 return ERR_PTR(-ENOSPC); 3107 } 3108 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki