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 X-Spam-Level: X-Spam-Status: No, score=-2.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC33FC433ED for ; Wed, 28 Apr 2021 07:38:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 24216613EE for ; Wed, 28 Apr 2021 07:38:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 24216613EE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 906AE6B0036; Wed, 28 Apr 2021 03:38:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8B7266B006E; Wed, 28 Apr 2021 03:38:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 757DA6B0070; Wed, 28 Apr 2021 03:38:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0006.hostedemail.com [216.40.44.6]) by kanga.kvack.org (Postfix) with ESMTP id 567046B0036 for ; Wed, 28 Apr 2021 03:38:09 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 0D577181AEF3C for ; Wed, 28 Apr 2021 07:38:09 +0000 (UTC) X-FDA: 78080972298.18.585C3E3 Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) by imf05.hostedemail.com (Postfix) with ESMTP id 82812E00012A for ; Wed, 28 Apr 2021 07:38:06 +0000 (UTC) Received: by mail-ej1-f45.google.com with SMTP id l4so93111124ejc.10 for ; Wed, 28 Apr 2021 00:38:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=QkJ4vpHSUWaGMQDLA7ZMyh0ynmNQBlz+ZqztYkEPyuQ=; b=m1fQRpKJMRs6XXRylK+K2Q9aA1XWDgL/5ejc0MtzpzqqmohWyRbvsAYZBx7t1e5gwN whc9QfJUCBjYraOo4H3vSdp2nRELYMDFyeQx8ZjVrGTf+gvS0EPrxv12pibm07j6aUXO UEHNbYm7CxkO2+qaMuBOleWngcp9mTOl0fnbNIk0izy0d2MWEeCwqEZaNEsGVFMzDJNK 0GBh3Tyr/fnsJ46U7dV1/pmvScgnZc1SI9ehKdSzUA2I8B8ZsxuMlu7ANtBh1abSqSo8 uqGRso+SN+xqu/SD8kEr4pz3D/aHuyIsb8wKUIDSlawkyAKLxkAf6IOIEUPUc1uQAu8q 8ssw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=QkJ4vpHSUWaGMQDLA7ZMyh0ynmNQBlz+ZqztYkEPyuQ=; b=qKXehwA/NbZ96bvQd/Y3mfCd3u8HoNrabnOJJZz8s1DZqJnKzjKmkebZnWaF1UvhZi PcxsOOwIVO6aexwwBiV0Zxl+rirVonGruWv+aWcrA88V9u+E8Y1n7kNWkPR2pV05xxPU +KZgjXeGSNP+Mc7cKe4n/p7jc4HU5ye/3oMm7KDjcyqqMgU3qt2W31vuNQ7eN1qt8/lA sJoQBJJLHkCAqL7nmFCE8+hVbQmhQcPwFaNexdCR9ZQphhzd5QisqiECn2fN16lLZnll En+Yx+5mH7XUOzvMtyP0fYAdmjBNAoWybgXJJntTh4a8tYmRzcMd69cxMy8GB1apnHQQ yuXw== X-Gm-Message-State: AOAM533/SBIeGIs4tn82Y483HKJsvEiYDJksDt+OjMvq8NymiCjn8qmL hx+NfcCW7miGEvrh8NSPE/4D7Lstm6gZe2pfmV0= X-Google-Smtp-Source: ABdhPJySpqvgCso+yQC6dVX2kkkQwqHjiOGBaSeWdfU9qgjYUCeNEwH5NLI2NPjjBZggzW7MPKQOJyRfnPmm+gBqy90= X-Received: by 2002:a17:907:7355:: with SMTP id dq21mr14701122ejc.157.1619595487363; Wed, 28 Apr 2021 00:38:07 -0700 (PDT) MIME-Version: 1.0 From: Shivank Garg Date: Wed, 28 Apr 2021 13:07:50 +0530 Message-ID: Subject: Is there a different memory allocation path other than the buddy allocator? To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, gregkh@linuxfoundation.org, sergey.senozhatsky@gmail.com, pmladek@suse.com Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 82812E00012A X-Stat-Signature: f3xe5n5nrgo4nwn4f8k1nqjgr33z5pyw Received-SPF: none (gmail.com>: No applicable sender policy available) receiver=imf05; identity=mailfrom; envelope-from=""; helo=mail-ej1-f45.google.com; client-ip=209.85.218.45 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1619595486-552895 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi Everyone! I'm understanding memory allocation in Linux and doing some changes in buddy allocator (__alloc_pages_nodemask) for my experiments. I create a new flag in `struct page->flags` (by adding a new flag in `enum pageflags` in `page-flags.h`. I set this bit permanently in __alloc_pages_nodemask (to not to be cleared once set and survive all further allocation and freeing). But I'm not able to see expected behavior. I'm guessing this is because Linux is also using some different path to allocate memory (probably during boot). Is my hypothesis correct? Is there any different memory allocation path other than buddy allocator? Where can I find it? To keep the newly added bit in the page_flag set for 'struct page' lifetime. I make sure not to clear it while freeing by unsetting it in "#define PAGE_FLAGS_CHECK_AT_PREP \ - (((1UL << NR_PAGEFLAGS) - 1) & ~__PG_HWPOISON & ~(1UL << PG_NEWEXPFLAG))" I know adding new bits in page->flag is probably not a good idea but this if for better understanding :) Thank You and stay safe! Best Regards, Shivank