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=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 8B34CC47404 for ; Fri, 11 Oct 2019 21:32:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 438192190F for ; Fri, 11 Oct 2019 21:32:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="STO7w8VB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 438192190F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B0FD68E0001; Fri, 11 Oct 2019 17:32:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AC0DB6B0005; Fri, 11 Oct 2019 17:32:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9AFA28E0001; Fri, 11 Oct 2019 17:32:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0028.hostedemail.com [216.40.44.28]) by kanga.kvack.org (Postfix) with ESMTP id 799536B0003 for ; Fri, 11 Oct 2019 17:32:36 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 0EEDF40FC for ; Fri, 11 Oct 2019 21:32:36 +0000 (UTC) X-FDA: 76032803112.22.blow01_50db4af94b02f X-HE-Tag: blow01_50db4af94b02f X-Filterd-Recvd-Size: 3224 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf46.hostedemail.com (Postfix) with ESMTP for ; Fri, 11 Oct 2019 21:32:35 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4C6CF206CD; Fri, 11 Oct 2019 21:32:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570829554; bh=kvNNeJghIHNqYqDMckjP1d9KcYViiPE0BC0buXkxp1c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=STO7w8VBNrpR/Hf0V3c5LV1Zsf5R6ppG57RPbf9QX7ow61uvbZtOP9Xee5Pw1PMqS 5rcpiALEeuFu0SMOaVO4jbYgViTXdMrKQfs6h+oa+rT8EegybJ2lTplBurja+NH58c omJn6NY/bqEt/YPER6sIm9fW962XwLJOY5J+QOzg= Date: Fri, 11 Oct 2019 14:32:31 -0700 From: Andrew Morton To: Johannes Weiner Cc: Minchan Kim , linux-mm , LKML , Sahkeel Butt , Minchan Kim Subject: Re: [PATCH] mm: annotate refault stalls from swap_readpage Message-Id: <20191011143231.e338e0ef337492e83233ad39@linux-foundation.org> In-Reply-To: <20191010191747.GA31673@cmpxchg.org> References: <20191010152134.38545-1-minchan@kernel.org> <20191010191747.GA31673@cmpxchg.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Thu, 10 Oct 2019 15:17:47 -0400 Johannes Weiner wrote: > On Thu, Oct 10, 2019 at 08:21:34AM -0700, Minchan Kim wrote: > > From: Minchan Kim > > > > If block device supports rw_page operation, it doesn't submit bio > > so annotation in submit_bio for refault stall doesn't work. > > It happens with zram in android, especially swap read path which > > could consume CPU cycle for decompress. It is also a problem for > > zswap which uses frontswap. > > > > Annotate swap_readpage() to account the synchronous IO overhead > > to prevent underreport memory pressure. > > > > Cc: Johannes Weiner > > Signed-off-by: Minchan Kim > > Acked-by: Johannes Weiner > > Can you please add a comment to the caller? Lifted from submit_bio(): > > /* > * Count submission time as memory stall. When the device is > * congested, or the submitting cgroup IO-throttled, > * submission can be a significant part of overall IO time. > */ This? --- a/mm/page_io.c~mm-annotate-refault-stalls-from-swap_readpage-fix +++ a/mm/page_io.c @@ -361,6 +361,11 @@ int swap_readpage(struct page *page, boo VM_BUG_ON_PAGE(!PageLocked(page), page); VM_BUG_ON_PAGE(PageUptodate(page), page); + /* + * Count submission time as memory stall. When the device is congested, + * or the submitting cgroup IO-throttled, submission can be a + * significant part of overall IO time. + */ psi_memstall_enter(&pflags); if (frontswap_load(page) == 0) { _