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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2AFD3C433EF for ; Wed, 12 Jan 2022 08:07:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=czEIwkhD6KshfZCwk/0abX5sms6Fai+ksXoTXUJ1Jgs=; b=2GLCY242ImThuV HJ9vDSkQIxpAAdmrkQCaJYgrjf/O/BPjFEiwmBHAPW5/QXurQXt1clgvMZp1z5aYCqYwWsgn5G5QP 1oGEQE/FKPRiGAFzkr3xiN349UkFZ5fhTYF+5t9LxW1tzkbk9EerLHE7PyzEn9waSC1PZgXfBnV7f Uvrwx7g40EYrI/A0OpuxFaAS7jlLLe7OamSCan4nxkYsjKzftb2VbXPITiBpyx198hVcHntm962IN 4cxZRzr5KweB5ZCG6ooWltqo5m8XtLE0uO/X83DANQNJDJpdBdwmr+ky+3wdTNppLrS6sJ0/m5cz+ P3Sk0qnocrXJDwoAdMxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7Ydu-001Suk-TX; Wed, 12 Jan 2022 08:06:03 +0000 Received: from mail-io1-xd33.google.com ([2607:f8b0:4864:20::d33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7Ydp-001St7-QC for linux-arm-kernel@lists.infradead.org; Wed, 12 Jan 2022 08:06:00 +0000 Received: by mail-io1-xd33.google.com with SMTP id w22so2500077iov.3 for ; Wed, 12 Jan 2022 00:05:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=pyw7GGJuc0hBOwmctWzhV5NE4YVpQMRChj4A/vKkkr4=; b=Z+qDYRtw4H7+Xhjv9rXrIpQm265j7kHSqnL11bYAwhEcsXLlyCTMo4DGQMSeyO22BX IjKFWkNtLTgesG7Dn90valcqe2XUfiJ5fv7aqbCbm0gtpV2aRAJ/6H/f6hZL/ZpJXmh9 6cbze64uaBbCwy+JMGzKYboFBVl+cMocBG9e5v+YJmevCYJ0bH0chy6VC9DXMG/IAWO8 bwJQ8FzyaP+8SF9sUohyCD0DwZkzr1qLhTz8HHaHRF9v1ge8ypjGonWRsQH18MvTwvnc YR1tfC6ouTRJowyCKbTSk44cHOVHtB/1i7achYXAt7eVF4T5cfzcr61g8W0DZC6jFbjr H3ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=pyw7GGJuc0hBOwmctWzhV5NE4YVpQMRChj4A/vKkkr4=; b=i2bK7jxFLHb+Reu2rLFwt3yF3aIVNwo2UY5nK94yPntdXf72Cz8if7gH4/VWxk1v3j O6F1Ckq9NWqEuGquiO65p7IQGUMi/r5pPEiBYbKt90dcVxdW4GzbWx8ciwjdI6oln49o BQUbtWi8e2eC2/IbO7L8f5zQpFwCM73u2OGFYTEkv+0esVWj6bkzwvfmXjincPl/+9oa Dgq78Q1SF6a5E++cMr8iZSdXGVNPohG/tI52fjd+Q08vDMoyk+RLZ9ilXpRHFuM2AsBZ gQy0s5vBeg4MsM1zUstcX7HWb+cK+sC4xutln92HcGmZPFDbmoE34Dx8b+RMOyRm7uY3 GoaA== X-Gm-Message-State: AOAM531pkpoXAB3ThP+jp+542DjneLv5MdPZ62q7C8Jch1WemuDHJAzi GCfux0rLB+WFtGsoIM0REgMGsA== X-Google-Smtp-Source: ABdhPJxS1FZp/i/SPqHdj4pGDjPeqMB4/I876fPMsGFsuuH99sxVcJWSlXkHHhif8uuR0sVcS/X06A== X-Received: by 2002:a05:6638:d01:: with SMTP id q1mr4064289jaj.248.1641974756815; Wed, 12 Jan 2022 00:05:56 -0800 (PST) Received: from google.com ([2620:15c:183:200:b6b6:70f4:b540:6383]) by smtp.gmail.com with ESMTPSA id c3sm1856408iow.28.2022.01.12.00.05.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 00:05:56 -0800 (PST) Date: Wed, 12 Jan 2022 01:05:51 -0700 From: Yu Zhao To: "Aneesh Kumar K.V" Cc: Andrew Morton , Linus Torvalds , Andi Kleen , Catalin Marinas , Dave Hansen , Hillf Danton , Jens Axboe , Jesse Barnes , Johannes Weiner , Jonathan Corbet , Matthew Wilcox , Mel Gorman , Michael Larabel , Michal Hocko , Rik van Riel , Vlastimil Babka , Will Deacon , Ying Huang , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, page-reclaim@google.com, x86@kernel.org, Konstantin Kharlamov Subject: Re: [PATCH v6 7/9] mm: multigenerational lru: eviction Message-ID: References: <20220104202227.2903605-1-yuzhao@google.com> <20220104202227.2903605-8-yuzhao@google.com> <87czkyzhfe.fsf@linux.ibm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87czkyzhfe.fsf@linux.ibm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220112_000557_870443_CE0C5410 X-CRM114-Status: GOOD ( 20.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jan 11, 2022 at 04:07:57PM +0530, Aneesh Kumar K.V wrote: > ... > > +static int isolate_folios(struct lruvec *lruvec, struct scan_control *sc, int swappiness, > > + int *type_scanned, struct list_head *list) > > +{ > > + int i; > > + int type; > > + int scanned; > > + int tier = -1; > > + DEFINE_MIN_SEQ(lruvec); > > + > > + VM_BUG_ON(!seq_is_valid(lruvec)); > > + > > + /* > > + * Try to make the obvious choice first. When anon and file are both > > + * available from the same generation, interpret swappiness 1 as file > > + * first and 200 as anon first. > > + */ > > + if (!swappiness) > > + type = 1; > > + else if (min_seq[0] < min_seq[1]) > > + type = 0; > > + else if (swappiness == 1) > > + type = 1; > > + else if (swappiness == 200) > > + type = 0; > > + else > > + type = get_type_to_scan(lruvec, swappiness, &tier); > > + > > Wondering wether it will make it simpler to use > #define ANON 0 > #define FILE 1 > > and then > else if (min_seq[ANON] < min_seq[FILE]) > type = ANON; > > The usage of 0/1 across code do confuse I agree, and I plan to do this later because the existing code uses this convention and needs renaming too. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel