From patchwork Tue Apr 18 19:12:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Weiner X-Patchwork-Id: 13216090 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 02107C77B78 for ; Tue, 18 Apr 2023 19:13:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 864198E0001; Tue, 18 Apr 2023 15:13:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B0EB900003; Tue, 18 Apr 2023 15:13:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4A11B8E0001; Tue, 18 Apr 2023 15:13:25 -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 33E9D8E0003 for ; Tue, 18 Apr 2023 15:13:25 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id AD41F14041E for ; Tue, 18 Apr 2023 19:13:24 +0000 (UTC) X-FDA: 80695460328.22.3DEB14B Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) by imf12.hostedemail.com (Postfix) with ESMTP id A277740014 for ; Tue, 18 Apr 2023 19:13:21 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=cmpxchg-org.20221208.gappssmtp.com header.s=20221208 header.b=x7kihz2X; spf=pass (imf12.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.219.52 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org; dmarc=pass (policy=none) header.from=cmpxchg.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681845201; a=rsa-sha256; cv=none; b=WFpdmLU/rt/AMtQfXeOKEv5hVxsq+mKfU+n+xTcDwCvE3rt5AsZTQzLhv9a8X82g/0nnkJ GjbdMW4s6ECIEBcSopTD0M28fcYmR+m5E8tmj1shzcLADzzjceYly+vvYma/5wCKC3qgBq cBbiG36BHF+rm7WOUHyBNYIwwvRHL+A= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=cmpxchg-org.20221208.gappssmtp.com header.s=20221208 header.b=x7kihz2X; spf=pass (imf12.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.219.52 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org; dmarc=pass (policy=none) header.from=cmpxchg.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681845201; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=k7sno8AaRf5ATInZUw+i9Aey3v69SOK+YNtRO/2P9OU=; b=AkNH1kXkoCuCETjG3WnhQJBN6pzl5VfvntgLDQesfIsWUpPYK+vfWNeQimfDbG4Rm12EBn YA5TSwMz5Jo9IX6wdVI0Zr0ruPMrYFErw/6cDNyp5Mplxjt6reZCstsIwaKt0ZUOiie0hh 32l3idfRFZviES433SuOhOCZM3ADzxE= Received: by mail-qv1-f52.google.com with SMTP id m16so18343800qvx.9 for ; Tue, 18 Apr 2023 12:13:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20221208.gappssmtp.com; s=20221208; t=1681845200; x=1684437200; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=k7sno8AaRf5ATInZUw+i9Aey3v69SOK+YNtRO/2P9OU=; b=x7kihz2Xek9Oawcxi+XxZhyApuNkNkSuXAlGa0k24xE/zxYmZiL9Tjnypqyo29xZrW Nsmvw/Opca5Epg2iXzQaqdiJrL5rqFjWGypHqp5urO1vUn8xS+vqGK55FJzonBr1mCwf wGaiiiFg2tItrhXI7KwlkaJG/RDfu09WqpY33e+D80EVxDPradvBJJ12Je5vjNrE+TPi ts+YdchVOie8BtYVf5YyCDVqV+r9hhn3Nl1kzyCzI5gGydNCC6lEPeXQFfpGWMSh2+pi CGhIO6Il7AoD+ydlRVCr5v40EZuhLfXbDgvfOUIzqKX+MJNjjoo0qr3XT7MqqIkU6bO/ IqJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681845200; x=1684437200; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=k7sno8AaRf5ATInZUw+i9Aey3v69SOK+YNtRO/2P9OU=; b=AEyEf5m4jpXOJtE6F9u/zPXJNDFe0iSfXQ53MqqXVvuvGnAxSnsBnpM86qXEujO2/E g+qD1gJXFw+pBe5EwR6aPh/0UpNuTpNEiiAGgXy09EGtiMq4IN1iTNA2ZhD1JNgqAIbO bpMO6ckOIrYMQxdlsjNN5oqK4SUnDP/isl+Xm3TjTDmDIdf1tM+fElRree5/KoA4eIaw C1X89UGYlJWbKoK80Cdz3/QjI0ueC7yZclbv10fLgvq7TT005TOlLADTmDZW308NzL79 1CFTITjVe3+MEo6BjPXm7WsnZE8iJXiDuCuA9f7NO2BZmkStPVcXrfy5YVu/J9inMbKR zuyw== X-Gm-Message-State: AAQBX9dmZak7coi+4Tl96W0cm7YdVnSbmbFYRW3t9egY8blhnIYDjYVO oowGutI8+s73ZTrb/0am9aQoQSDen/Rwg8xwrVY= X-Google-Smtp-Source: AKy350Y2WvA1kj6Bsm7oquBxOdrZDbffru8om2OFKpHsG6Pe1CEinFIFTzd6IhJxiRR2FIVaaYlT9A== X-Received: by 2002:a05:6214:c4b:b0:5ef:807b:2a96 with SMTP id r11-20020a0562140c4b00b005ef807b2a96mr11066482qvj.21.1681845200482; Tue, 18 Apr 2023 12:13:20 -0700 (PDT) Received: from localhost ([2620:10d:c091:400::5:e646]) by smtp.gmail.com with ESMTPSA id k21-20020a05620a0b9500b0074e04516389sm659536qkh.35.2023.04.18.12.13.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Apr 2023 12:13:20 -0700 (PDT) From: Johannes Weiner To: linux-mm@kvack.org Cc: Kaiyang Zhao , Mel Gorman , Vlastimil Babka , David Rientjes , linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: [RFC PATCH 01/26] block: bdev: blockdev page cache is movable Date: Tue, 18 Apr 2023 15:12:48 -0400 Message-Id: <20230418191313.268131-2-hannes@cmpxchg.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230418191313.268131-1-hannes@cmpxchg.org> References: <20230418191313.268131-1-hannes@cmpxchg.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: A277740014 X-Rspamd-Server: rspam01 X-Stat-Signature: 3gpps8hzyx3cidhoqsdkshkyarh7qchn X-HE-Tag: 1681845201-911749 X-HE-Meta: U2FsdGVkX19Fewrw/MUc1LI2anyjO6lPK4uGPwymSQeV+4obVpRvxSRYOiLN+bTyVcrKeJ1M65vk53rz9DnLxWVer+YNNpA2kQJm7Ow0glHsZsuvx4cSms/eqxp42tf8qdPmjrsbU/SYFSkbrPQFOUDJbR7iPZCwh0eUBg5QK/Jb5BEr00o1nQpEs7/YNmv9DFmzuTrk/yQYvaj+7WCBVqrLxPRzUfzQKGR1XlA36RXbTyrU3rtIlMClQC9kcUvGpYxlrLtltoarqLbySK9hocfD7ed4F1Li7W40NBvPPakahnBUnuY1Nnol92+malc2sfdGbzdjagapFKYXdXB3IXU0MZSFo1TnG0NZQ9cctvYgK7eOp9MdGJCEpISip3BorcNYwNAJiC3+pmh4Ma8k24uV6L3lm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= 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: While inspecting page blocks for the type of pages in them, I noticed a large number of blockdev cache in unmovable blocks. However, these pages are actually on the LRU, and their mapping has a .migrate_folio callback; they can be reclaimed and compacted as necessary. Put them into movable blocks, so they don't cause pollution, and subsequent proliferation, of unmovable blocks. Signed-off-by: Johannes Weiner --- block/bdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/bdev.c b/block/bdev.c index edc110d90df4..6abe4766d073 100644 --- a/block/bdev.c +++ b/block/bdev.c @@ -488,7 +488,7 @@ struct block_device *bdev_alloc(struct gendisk *disk, u8 partno) inode->i_mode = S_IFBLK; inode->i_rdev = 0; inode->i_data.a_ops = &def_blk_aops; - mapping_set_gfp_mask(&inode->i_data, GFP_USER); + mapping_set_gfp_mask(&inode->i_data, GFP_USER|__GFP_MOVABLE); bdev = I_BDEV(inode); mutex_init(&bdev->bd_fsfreeze_mutex);