Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3816475imm; Tue, 29 May 2018 14:23:54 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ/QEhhXhF752s4tcPWChWL6uGgxBslpAxK0kpajEaRpS48GLutMnRpFMvlj4MZiHsaT4UX X-Received: by 2002:a17:902:b907:: with SMTP id bf7-v6mr58599plb.331.1527629034120; Tue, 29 May 2018 14:23:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527629034; cv=none; d=google.com; s=arc-20160816; b=0nDZKafw+aBwEOmacHCEIwfNB1mdyOrcbFk9QkJcgIvS0wh8xdHiaRxaejLuprt/rm sDKGlVAqE6KvwtFNo1uavRkiB+K5eXFyrbZ5nfv/h7JHH3A3OlTTB2pwOoEjWLER3rPF fQM3T/SxkuG8DxHUeLuewH/CPvNwyVJ9/1UkY4/xDwAyxB5iPDDfLNn32PCXNHRh8dN7 6V2w8GNC+5SQrmSzM9abRcA+eLWprHfoa0E3TS7fy9cIQGXqE6H8iEboYHWxV4HbvIZb KfhYG+YxQOxXi97mGh13db2rU8ZY4ySlxFAHJvFTtpDqeYCwXDxdt23cQJuwmFwSl2Kl QmgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:arc-authentication-results; bh=PN/nWKQLg21E/rV05t1OoXBNqfvsbn3JrFEdFIuPAYQ=; b=rT+yD/5KfF06goCKv5sCrFbQO6oy25JQ+4diWmvpAcxa31Bhd81JIxe/GPSijGnZ9x VbHE2LlCcyglQH+bjE/ZEf/r2POWeXnBTM6ZpEt8XqeKAaC3h9ABRE69z8EQ0mRMFCJU gLEtHaMfe6ajGnficHeLh3jYeE8Hp1y+KynbnbZg01fdm5ohHDzl86erShv7Bg2fmEyt LxrbSwh6G8JoYc8GjzRUVqlSxkgGp/Hdp/joFkSy9ldSauuLBdhL+q13hJ2gUZvqzvEm axGOBhbMgGJJ304PxShEbPu2X8IbDed6/skDCW1FZ9ZwEctBtc4iFxJStlxc5G0UFDzf AlgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@toxicpanda-com.20150623.gappssmtp.com header.s=20150623 header.b=W34Q8/aK; 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 b35-v6si33424267plh.36.2018.05.29.14.23.40; Tue, 29 May 2018 14:23:54 -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=@toxicpanda-com.20150623.gappssmtp.com header.s=20150623 header.b=W34Q8/aK; 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 S967496AbeE2VU3 (ORCPT + 99 others); Tue, 29 May 2018 17:20:29 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:41029 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967178AbeE2VRf (ORCPT ); Tue, 29 May 2018 17:17:35 -0400 Received: by mail-qt0-f194.google.com with SMTP id g13-v6so20593213qth.8 for ; Tue, 29 May 2018 14:17:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=PN/nWKQLg21E/rV05t1OoXBNqfvsbn3JrFEdFIuPAYQ=; b=W34Q8/aKBX/6YXFAvZB3haDDoRmC3DTSKid8xBURzXPA/5Oke3emCvD0yLAJSeKFCW QRxlemMpVFYdxZE3AkfNJ+/easTLtVqbEV8Qsfd5BsGbSj1gF6bK+da4pTpoykcTU57q Ey7tTlrfQi76OIm8S6KqFlyrMAKY+TZajEzyo1SjOm+9tn6Vhe1xQM5jycs6y3rRi/4r zkG4AVNyZ2E3NCpbkf5PPgNYjOqD3DUPajFEEZMhuhjjXXXS0urwgJDRhaRpiE50sL/f DDE8Z7vD+KEEhj0ZHl7zxV5jH4g6qlgJkYhtqVNG/nc7rLvpIzXRD3a572cLJ4bJBWPo sR1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=PN/nWKQLg21E/rV05t1OoXBNqfvsbn3JrFEdFIuPAYQ=; b=txO4AlOimXJwyFZipqeAaTvEJFha1BZbLIQ7voC2+yASCunPaZkRAMR0KiQ7vskfBk GrFjl6XXePv+2rzlWT2cUclQ2+oOmxhctVHxzQR6N21Yg5fq+u/rax4wnSwl6tdXqyJE hw10CUh8bdyzCO8OGeOPjytybzme6dIsKWUhi1U1xc4t2Pl3JLOOoVDeGEwAMDv3mZjW Z0eSzZwmc9jF0TbXG4lN+z+okFCgz6RXpbwDSfs2RtfEoBA1fzIUU8MzaUABPJH1LyET yFgozj4N9xtDTHwegsl/0g6qKf5WSwYL9IlLP5yFiBngcFcz2H53nqxQR7bE/QG8mQFo PP+g== X-Gm-Message-State: APt69E3z/IAGrny+uM5DF9ODUmHpC4N/8VOyUE9bRIe0OZLwKgyyZjYV rKZV10Um/4vB5WO/Pl6LA4xMxw== X-Received: by 2002:a0c:de05:: with SMTP id t5-v6mr81380qvk.180.1527628654948; Tue, 29 May 2018 14:17:34 -0700 (PDT) Received: from localhost (cpe-2606-A000-4381-1201-225-22FF-FEB3-E51A.dyn6.twc.com. [2606:a000:4381:1201:225:22ff:feb3:e51a]) by smtp.gmail.com with ESMTPSA id 3-v6sm10641280qtx.16.2018.05.29.14.17.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 May 2018 14:17:34 -0700 (PDT) From: Josef Bacik To: axboe@kernel.dk, kernel-team@fb.com, linux-block@vger.kernel.org, akpm@linux-foundation.org, linux-mm@kvack.org, hannes@cmpxchg.org, linux-kernel@vger.kernel.org, tj@kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 05/13] swap,blkcg: issue swap io with the appropriate context Date: Tue, 29 May 2018 17:17:16 -0400 Message-Id: <20180529211724.4531-6-josef@toxicpanda.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180529211724.4531-1-josef@toxicpanda.com> References: <20180529211724.4531-1-josef@toxicpanda.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tejun Heo For backcharging we need to know who the page belongs to when swapping it out. Signed-off-by: Tejun Heo Signed-off-by: Josef Bacik --- mm/page_io.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mm/page_io.c b/mm/page_io.c index a552cb37e220..61e1268e5dbc 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -339,6 +339,16 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc, goto out; } bio->bi_opf = REQ_OP_WRITE | REQ_SWAP | wbc_to_write_flags(wbc); +#if defined(CONFIG_MEMCG) && defined(CONFIG_BLK_CGROUP) + if (page->mem_cgroup) { + struct cgroup_subsys_state *blkcg_css; + + blkcg_css = cgroup_get_e_css(page->mem_cgroup->css.cgroup, + &io_cgrp_subsys); + bio_associate_blkcg(bio, blkcg_css); + css_put(blkcg_css); + } +#endif count_swpout_vm_event(page); set_page_writeback(page); unlock_page(page); -- 2.14.3