Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1447687ybp; Fri, 11 Oct 2019 14:33:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqz2t2esD+KTAxG2CYF25+TbTa3nXbqkQoAsuLYKoLHFAqehC3bU/gWaJga9lsArVPQlq2Y9 X-Received: by 2002:a05:6402:1252:: with SMTP id l18mr15778261edw.64.1570829590803; Fri, 11 Oct 2019 14:33:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570829590; cv=none; d=google.com; s=arc-20160816; b=stIKbHhKrbQFv2cwZoPQ5rWHO11/QFaILcE/OmkLYm9RC+4o9aY3wGrr02YH5WQWvb yZkmNrintqSMYqAd7TLLuzTvRIyloH/b875RjSo48vcM7IOda26uLxAaZG6ptEH5OebS 4X8XM9Q+vnu4f5rV9bg4wqLgD60SdAVfCn1zKGe7OfRfnOTnKOcbphBK7TuS3RIyfRoa SEHEB0+bGnQ29QbYl43b6XdhEzZrc0aDJCOes+/BGZYkk6F+SB4hWONLdr6ylkRIz83y bY6+QTCfLqs+yEaLo0CJ20zJK2C8UUbHqSEN4qQB5G8WH0BeXv5oDuYqpjA83NVGicDc KyHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=LbTrmhclyo/W3z2bvRBSihoxoOIVoKngOa0h9CJg990=; b=UJ+T3KdGJIPoguvU0u36QZTz5L5RxvrghPIkp0Q/hTfgbXsrFeHPJY3C4i5bp0WDxf xDxJCRnR1FlU3FHXS7/NSbJDW42otXnsNSnUo1ebGRsSvAlVf777LiytLpi28xK44rgB +F9xJl7HfvDcKiWwD8SsX+svthN/x0VROvXVo8gzMDACCJslVS5KohiQSUxuRiyT3hsL BKgJBxFNfvVZcW8GF6pRHoJg7yU5+HO/DK8obZdVeHP0Tb81lqZrYyUDR7cCIgWG60q1 DwSR4hto9gh1V8FTjMV992w1jI1HAXYMbtE8+2LwfuqXQDgSjdwMIK3r8qA0/Zwqdp+r EWeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=STO7w8VB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a54si6107324edc.333.2019.10.11.14.32.46; Fri, 11 Oct 2019 14:33:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=STO7w8VB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729102AbfJKVcg (ORCPT + 99 others); Fri, 11 Oct 2019 17:32:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:56734 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726255AbfJKVcg (ORCPT ); Fri, 11 Oct 2019 17:32:36 -0400 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) { _