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 CC777CD37B1 for ; Tue, 3 Sep 2024 22:06:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4ADA48D01E7; Tue, 3 Sep 2024 18:06:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 45DA78D01E4; Tue, 3 Sep 2024 18:06:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 300298D01E7; Tue, 3 Sep 2024 18:06:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 0DAB98D01E4 for ; Tue, 3 Sep 2024 18:06:07 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id A54E71C4B52 for ; Tue, 3 Sep 2024 22:06:06 +0000 (UTC) X-FDA: 82524810732.16.86527A5 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) by imf17.hostedemail.com (Postfix) with ESMTP id B4E7240017 for ; Tue, 3 Sep 2024 22:06:04 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=uSwckMWr; spf=pass (imf17.hostedemail.com: domain of yosryahmed@google.com designates 209.85.218.51 as permitted sender) smtp.mailfrom=yosryahmed@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725401089; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=VuoNYko0/HpQLTPUOitl3tKBNtOkoTO1QwU3Z9zqUKY=; b=MYhfg05I0v4N/yrCbIn1t4AiUTG96cLXVxV8+ps95Mgn8S0WghsT9zw4Bg/gtxLuq4kYW8 u8WVRf9iPos/0CizdnFIcnSVDvVNnm4VGlTwcC4SlQ7yS2VekU9a6/h1pb9l/takrqMPp2 BV+ETbnLFsMpCC1KCzrYC4utNBV3i5E= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=uSwckMWr; spf=pass (imf17.hostedemail.com: domain of yosryahmed@google.com designates 209.85.218.51 as permitted sender) smtp.mailfrom=yosryahmed@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725401089; a=rsa-sha256; cv=none; b=qEqknxIO+c8T8/d6BXBYgx+AezJbHEqoW3uMWTFaiyVIeSuitOpMY0HvOTjHrjpBhfLnMw DOU6al7bH+3U8zyaAidmlfNJs1npdRsG8gn6oTv+MWYrPQ2plubAUVMI9ybqu5dtkYwiXE 4SSVG5zzZRh5ZmzyX8JJzEL7LGKj65w= Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a86e5e9ff05so685056766b.1 for ; Tue, 03 Sep 2024 15:06:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1725401163; x=1726005963; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=VuoNYko0/HpQLTPUOitl3tKBNtOkoTO1QwU3Z9zqUKY=; b=uSwckMWr1Olx6dCrEzJNxpZJvs3jczeyapKiFAygMGrO3LfGFtle4r5lvOvt0iH4tw vCxiS2xIIgWQijPFYg5LigUuG+IfYbIx08MyYb+AQwM3LfUl0SscokBOooyOq0Nz6RB9 1cqQnSjwaoOOm1m3cfscBXXHivq2owrA2pQb5sySqaB9AUzeuSuvCeRw2ooVGuKjd1Qd ebqjwFGcNbydsnGomAqO5K6BLKyL+zCrIddhdxrXz7KpSAIhnpgbjZfEOA2xCQWlUQyv GyuN2ros8VrRgnoYv40Is4zaz0gyos2x6dz2ObDXYc9sRcqzu4okHiq0Jnqpm3rmQwhN PinQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725401163; x=1726005963; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VuoNYko0/HpQLTPUOitl3tKBNtOkoTO1QwU3Z9zqUKY=; b=EedU9TnxKL+ByKIwHlVPqh/GtJj50w7IskJhnXgrtWKUrGU3eJ6eJrqnf3lKQpXet/ vd5/37uB3MFpRg5fiZuOFShVmFouF4Q6bsOQ4An34h6cmILACYJCOmYVMFT7IV5RKDQs ZGKsbKpj6MyO80INvnARL+VKjOCqDNPOIV4I9g/renGckm0ltAwdjlLE8kd9lYIuSwJ/ +/cQDWbs8NutKzkG6Lel8DuI8a3MojyFZ76Esv6Vqyv4qPTq0/0TehiItwkQgH7MB+gy bNgfRatSaqOQZ7qnpc1oEu2fYY9vO/70XbPj4sXauxRBb6Kd7qOvOxOBM8a6HkK3vU3r 4A0g== X-Forwarded-Encrypted: i=1; AJvYcCXhZIoJNYGKHEhSsDho1o7bcgeHQdJKvP2bUKr5FmtPrCSul5y8Ff3RvFbuzwzPh5pIZwrWiRIFgQ==@kvack.org X-Gm-Message-State: AOJu0YxAlYmdBXfTT2kEOXQ6gf05pRPCPqwtuWu3b/Eb98GuvgcclKgD 02aPJJ28tlMpDOyres+RecGNAVPegoBPzxui7IMiKMqF+6Or4RE0xapkNMEXEVhl5a53l0hfyk7 7ThK3dzjrdpe51+sN/6i/S3JwD+d7xTvBlWJR X-Google-Smtp-Source: AGHT+IGT4lMxuEfw6OhI29VcR2MtQGxqfjPJ5fVa43iaBxkyQ6R4dEvkM0CtH83BD8AvXCi4rt/VjeUqqk0zJfJ92Tc= X-Received: by 2002:a17:907:3f09:b0:a86:8e3d:86e2 with SMTP id a640c23a62f3a-a8a32df30c3mr186623966b.11.1725401162448; Tue, 03 Sep 2024 15:06:02 -0700 (PDT) MIME-Version: 1.0 References: <20240821074541.516249-1-hanchuanhua@oppo.com> <20240821074541.516249-3-hanchuanhua@oppo.com> <20240903130757.f584c73f356c03617a2c8804@linux-foundation.org> In-Reply-To: From: Yosry Ahmed Date: Tue, 3 Sep 2024 15:05:25 -0700 Message-ID: Subject: Re: [PATCH v7 2/2] mm: support large folios swap-in for sync io devices To: Barry Song <21cnbao@gmail.com> Cc: Andrew Morton , Kairui Song , hanchuanhua@oppo.com, Usama Arif , linux-mm@kvack.org, baolin.wang@linux.alibaba.com, chrisl@kernel.org, david@redhat.com, hannes@cmpxchg.org, hughd@google.com, kaleshsingh@google.com, linux-kernel@vger.kernel.org, mhocko@suse.com, minchan@kernel.org, nphamcs@gmail.com, ryan.roberts@arm.com, senozhatsky@chromium.org, shakeel.butt@linux.dev, shy828301@gmail.com, surenb@google.com, v-songbaohua@oppo.com, willy@infradead.org, xiang@kernel.org, ying.huang@intel.com, hch@infradead.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Stat-Signature: 5365upnkpdt7qshkero58hax4wrzxedy X-Rspam-User: X-Rspamd-Queue-Id: B4E7240017 X-Rspamd-Server: rspam02 X-HE-Tag: 1725401164-831042 X-HE-Meta: U2FsdGVkX1/jfDz77ZOPvtZuSsS7Y4VUB26MYslLBtx954HnsQ7yZAR2uiiBa/tcUAQliKpxPERnQooNveXMIBXjPRrO/spQMs98CYJ7j9XN1CCiCc/wgMh6frUlqKX/XCq9n/o6k7qSikVv//XKi2sgiwgdDIeC7wwd0LER6pbVIZqeKLeDAaXX8ByusxczIPqlRwpx2vqWu2825Njy44P2UC0ttPM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=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: On Tue, Sep 3, 2024 at 2:36=E2=80=AFPM Barry Song <21cnbao@gmail.com> wrote= : > > On Wed, Sep 4, 2024 at 8:08=E2=80=AFAM Andrew Morton wrote: > > > > On Tue, 3 Sep 2024 11:38:37 -0700 Yosry Ahmed w= rote: > > > > > > [ 39.157954] RBP: 0000000000000000 R08: 0000000000000000 R09: 000= 0000000000007 > > > > [ 39.158288] R10: 0000000000000000 R11: 0000000000000246 R12: 000= 0000000000001 > > > > [ 39.158634] R13: 0000000000002b9a R14: 0000000000000000 R15: 000= 07ffd619d5518 > > > > [ 39.158998] > > > > [ 39.159226] ---[ end trace 0000000000000000 ]--- > > > > > > > > After reverting this or Usama's "mm: store zero pages to be swapped > > > > out in a bitmap", the problem is gone. I think these two patches ma= y > > > > have some conflict that needs to be resolved. > > > > > > Yup. I saw this conflict coming and specifically asked for this > > > warning to be added in Usama's patch to catch it [1]. It served its > > > purpose. > > > > > > Usama's patch does not handle large folio swapin, because at the time > > > it was written we didn't have it. We expected Usama's series to land > > > sooner than this one, so the warning was to make sure that this serie= s > > > handles large folio swapin in the zeromap code. Now that they are bot= h > > > in mm-unstable, we are gonna have to figure this out. > > > > > > I suspect Usama's patches are closer to land so it's better to handle > > > this in this series, but I will leave it up to Usama and > > > Chuanhua/Barry to figure this out :) > > I believe handling this in swap-in might violate layer separation. > `swap_read_folio()` should be a reliable API to call, regardless of > whether `zeromap` is present. Therefore, the fix should likely be > within `zeromap` but not this `swap-in`. I=E2=80=99ll take a look at this= with > Usama :-) I meant handling it within this series to avoid blocking Usama patches, not within this code. Thanks for taking a look, I am sure you and Usama will figure out the best way forward :)