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=-7.0 required=3.0 tests=INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 E6FC0C2BA83 for ; Fri, 14 Feb 2020 08:34:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 96C3320873 for ; Fri, 14 Feb 2020 08:34:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 96C3320873 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EA09B6B0608; Fri, 14 Feb 2020 03:34:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E50906B0609; Fri, 14 Feb 2020 03:34:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D8DEE6B060A; Fri, 14 Feb 2020 03:34:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0051.hostedemail.com [216.40.44.51]) by kanga.kvack.org (Postfix) with ESMTP id BD2556B0608 for ; Fri, 14 Feb 2020 03:34:47 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 462EC824556B for ; Fri, 14 Feb 2020 08:34:47 +0000 (UTC) X-FDA: 76488071814.15.level76_29bc72becdd21 X-HE-Tag: level76_29bc72becdd21 X-Filterd-Recvd-Size: 4134 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Fri, 14 Feb 2020 08:34:46 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id w15so9892676wru.4 for ; Fri, 14 Feb 2020 00:34:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=m744gpvb7f0f8+A+ehtYqq9qidkXTz706TB8wS7XMPk=; b=lKguadIxzpYNgJWO1+905/iI/sN98Z9GI6QruOKUJqCMxUM/Iym1CtNmJyAf5qsokR NIHm1oYbGV3Nt9yR8fyOvr3sTilsgNjUEA5uq6rvkG8EuDVS+DzFaLmiXzVcPZczLYqC HfPh0FdAgplHr0oS15Q3WoHvFhr8zjKxWqA+xiAYGS5p7fAax0fAA4TrJ+AZ+sql5QX4 u+10vjcRvQrL9VFPKO5XQY47OZVSJsZR3a6oJHVBiBmbKFyn+qhzIGJsdigUtSB/eoYs FQU5REQlt4HwIKNK3WsfTzA83g4/33ntQHPJZ2uRV3JVQQ6N66tnw5fwG/Tj8Cdb9vJV Qf7A== X-Gm-Message-State: APjAAAVIje29OJ6q0gX/FztXxABkAECUCT0E3TP9Zym3DU7ab2TzuDB2 sar5yWbH9z3DrmgPdJzmpwU= X-Google-Smtp-Source: APXvYqxGLu++IhPmvdaCcduZPUOaDQqPBeBzoAHKs2fmiofgdrfBT82oscGZw6XWPJIHhtRjLp/Z4g== X-Received: by 2002:adf:a381:: with SMTP id l1mr2756332wrb.102.1581669285598; Fri, 14 Feb 2020 00:34:45 -0800 (PST) Received: from localhost (ip-37-188-133-87.eurotel.cz. [37.188.133.87]) by smtp.gmail.com with ESMTPSA id u62sm3585521wmu.17.2020.02.14.00.34.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 00:34:44 -0800 (PST) Date: Fri, 14 Feb 2020 09:34:43 +0100 From: Michal Hocko To: Yang Shi Cc: willy@infradead.org, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: migrate.c: migrate PG_readahead flag Message-ID: <20200214083443.GO31689@dhcp22.suse.cz> References: <1581640185-95731-1-git-send-email-yang.shi@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1581640185-95731-1-git-send-email-yang.shi@linux.alibaba.com> 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: On Fri 14-02-20 08:29:45, Yang Shi wrote: > Currently migration code doesn't migrate PG_readahead flag. > Theoretically this would incur slight performance loss as the > application might have to ramp its readahead back up again. Even though > such problem happens, it might be hidden by something else since > migration is typically triggered by compaction and NUMA balancing, any > of which should be more noticeable. > > Migrate the flag after end_page_writeback() since it may clear > PG_reclaim flag, which is the same bit as PG_readahead, for the new > page. Looks like an omission. The readahead flag has been added later (2.6.23) while the migration predates 2.6.17. > Cc: Matthew Wilcox > Cc: Michal Hocko > Signed-off-by: Yang Shi Acked-by: Michal Hocko > --- > I didn't experience any real problem, found by visual inspection. And, this was > discussed in thread: https://lore.kernel.org/linux-mm/185ce762-f25d-a013-6daa-8c288f1ff791@linux.alibaba.com/T/#m1977ce1de513401b7d09d6fa14fcffe849580aae > > mm/migrate.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/mm/migrate.c b/mm/migrate.c > index edf42ed..f3c492d 100644 > --- a/mm/migrate.c > +++ b/mm/migrate.c > @@ -647,6 +647,14 @@ void migrate_page_states(struct page *newpage, struct page *page) > if (PageWriteback(newpage)) > end_page_writeback(newpage); > > + /* > + * PG_readahead share the same bit with PG_reclaim, the above > + * end_page_writeback() may clear PG_readahead mistakenly, so set > + * the bit after that. > + */ > + if (PageReadahead(page)) > + SetPageReadahead(newpage); > + > copy_page_owner(page, newpage); > > mem_cgroup_migrate(page, newpage); > -- > 1.8.3.1 -- Michal Hocko SUSE Labs