Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp1807952ybj; Sun, 22 Sep 2019 12:22:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqwBp5Pq7yIRPBp6hk3WZve9v95A++h+x2dESbNL7PT6Im5YiFnAOGmHHjAp/O1fGj8ArMiE X-Received: by 2002:a17:906:4910:: with SMTP id b16mr26901032ejq.301.1569180179449; Sun, 22 Sep 2019 12:22:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569180179; cv=none; d=google.com; s=arc-20160816; b=NlKelYy56VxS58kuOhBbS/HMvV/zIgGrQ9EZP67lWq+2fQZtbIgNQ6uWAEG61FeXoP 1o5bF49Ygpihx0YcZpaNmeV1XxM73JuhIhRWv8BZGjNxIloXbHxepytyYrxrpIJKOvhI mi/P/HglBmHmBX29KVbavnhxDHA0M7pmWmVgyYdWj6arQYm/Hbg4MbD5cb3ckAPh05QD fNnZqvctoHc53rrnSDJyhZQnK/1XAyEHF6kE2T9m48Wpbigd43gS1TVUtnR4z4QpAkuA NbWS2FrxGxvNaXbQbNAEbJAF+yliAuaxKeV77ACYrbJGK720a5pbexLa55cXKvLto3e/ bzTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=ZjN2J/gJTJAi6OR7QbzB28yUxayAVpWtji7ZIuuJpEs=; b=sGku9cik79qRrSYFjpk0JSrv0xgXOnNsTZNFuVCX3Raq6+kJ3kja0LMvOergUV/LE2 QlSZGZ7V0Xz2C5CDsEsR+YLFKFLbz1kD+eZ6TWFR3CU8L8aPQOwORS5xgFnBlQ8aPp3d V3Sf0qpXJma224e8YmyVC6N7FbCx/frIISEAnVwILxwd35ZjT6qeInuX6ZVgdaUapNdO FtW66TPVUSzrVerSTR93A5WjSllgX0mJ//qJJaJkswpAlUFRjiYLifW9lmPF8ma3XvhY m392hIt1hx9J1B5dJHULtRsnABqAH+GyzDC1njfB/oVr+iVNIb8PrItOb3UjfDF4zuXQ APyQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h20si5115512edb.218.2019.09.22.12.22.34; Sun, 22 Sep 2019 12:22:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727050AbfIVCNw convert rfc822-to-8bit (ORCPT + 99 others); Sat, 21 Sep 2019 22:13:52 -0400 Received: from mga18.intel.com ([134.134.136.126]:64842 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727027AbfIVCNv (ORCPT ); Sat, 21 Sep 2019 22:13:51 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Sep 2019 19:13:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,534,1559545200"; d="scan'208";a="182164757" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga008.jf.intel.com with ESMTP; 21 Sep 2019 19:13:50 -0700 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sat, 21 Sep 2019 19:13:50 -0700 Received: from crsmsx104.amr.corp.intel.com (172.18.63.32) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sat, 21 Sep 2019 19:13:50 -0700 Received: from crsmsx101.amr.corp.intel.com ([169.254.1.249]) by CRSMSX104.amr.corp.intel.com ([169.254.6.58]) with mapi id 14.03.0439.000; Sat, 21 Sep 2019 20:13:48 -0600 From: "Weiny, Ira" To: Matthew Wilcox , Andrew Morton CC: "linux-mm@kvack.org" , Atul Gupta , "linux-crypto@vger.kernel.org" Subject: RE: [PATCH v2 1/3] mm: Introduce page_size() Thread-Topic: [PATCH v2 1/3] mm: Introduce page_size() Thread-Index: AQHVcAsqYO/T6JFMt0+7/3dzSRFwbac1twUAgAE+cXA= Date: Sun, 22 Sep 2019 02:13:46 +0000 Message-ID: <2807E5FD2F6FDA4886F6618EAC48510E89916163@CRSMSX101.amr.corp.intel.com> References: <20190721104612.19120-1-willy@infradead.org> <20190721104612.19120-2-willy@infradead.org> <20190723004307.GB10284@iweiny-DESK2.sc.intel.com> <20190723160248.GK363@bombadil.infradead.org> <20190920162848.950dd70264e670a485f410dc@linux-foundation.org> <20190921010948.GD15392@bombadil.infradead.org> In-Reply-To: <20190921010948.GD15392@bombadil.infradead.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzRhZTQ2ODItNGJhOC00NzFlLWFkYjgtNGM3YjNkMTgyMDU2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiUzZrOEkzeFNObTNzXC9jMW1VaGFzY1BWRnJQV3FkZG5idmRlbitEdHYwbENHRFVFQWYrTU95ZDlKY2swV1VlTG0ifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [172.18.205.10] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org > On Fri, Sep 20, 2019 at 04:28:48PM -0700, Andrew Morton wrote: > > On Tue, 23 Jul 2019 09:02:48 -0700 Matthew Wilcox > wrote: > > > > > On Mon, Jul 22, 2019 at 05:43:07PM -0700, Ira Weiny wrote: > > > > > diff --git a/drivers/crypto/chelsio/chtls/chtls_io.c > > > > > b/drivers/crypto/chelsio/chtls/chtls_io.c > > > > > index 551bca6fef24..925be5942895 100644 > > > > > --- a/drivers/crypto/chelsio/chtls/chtls_io.c > > > > > +++ b/drivers/crypto/chelsio/chtls/chtls_io.c > > > > > @@ -1078,7 +1078,7 @@ int chtls_sendmsg(struct sock *sk, struct > msghdr *msg, size_t size) > > > > > bool merge; > > > > > > > > > > if (page) > > > > > - pg_size <<= compound_order(page); > > > > > + pg_size = page_size(page); > > > > > if (off < pg_size && > > > > > skb_can_coalesce(skb, i, page, off)) { > > > > > merge = 1; > > > > > @@ -1105,8 +1105,7 @@ int chtls_sendmsg(struct sock *sk, struct > msghdr *msg, size_t size) > > > > > > __GFP_NORETRY, > > > > > order); > > > > > if (page) > > > > > - pg_size <<= > > > > > - > compound_order(page); > > > > > + pg_size <<= order; > > > > > > > > Looking at the code I see pg_size should be PAGE_SIZE right before > > > > this so why not just use the new call and remove the initial assignment? > > > > > > This driver is really convoluted. I wasn't certain I wouldn't break > > > it in some horrid way. I made larger changes to it originally, then > > > they touched this part of the driver and I had to rework the patch > > > to apply on top of their changes. So I did something more minimal. > > > > > > This, on top of what's in Andrew's tree, would be my guess, but I > > > don't have the hardware. > > > > > > diff --git a/drivers/crypto/chelsio/chtls/chtls_io.c > > > b/drivers/crypto/chelsio/chtls/chtls_io.c > > > index 925be5942895..d4eb0fcd04c7 100644 > > > --- a/drivers/crypto/chelsio/chtls/chtls_io.c > > > +++ b/drivers/crypto/chelsio/chtls/chtls_io.c > > > @@ -1073,7 +1073,7 @@ int chtls_sendmsg(struct sock *sk, struct > msghdr *msg, size_t size) > > > } else { > > > int i = skb_shinfo(skb)->nr_frags; > > > struct page *page = TCP_PAGE(sk); > > > - int pg_size = PAGE_SIZE; > > > + unsigned int pg_size = 0; > > > int off = TCP_OFF(sk); > > > bool merge; > > > > > > @@ -1092,7 +1092,7 @@ int chtls_sendmsg(struct sock *sk, struct > msghdr *msg, size_t size) > > > if (page && off == pg_size) { > > > put_page(page); > > > TCP_PAGE(sk) = page = NULL; > > > - pg_size = PAGE_SIZE; > > > + pg_size = 0; > > > } > > > > > > if (!page) { > > > @@ -1104,15 +1104,13 @@ int chtls_sendmsg(struct sock *sk, struct > msghdr *msg, size_t size) > > > __GFP_NOWARN | > > > __GFP_NORETRY, > > > order); > > > - if (page) > > > - pg_size <<= order; > > > } > > > if (!page) { > > > page = alloc_page(gfp); > > > - pg_size = PAGE_SIZE; > > > } > > > if (!page) > > > goto wait_for_memory; > > > + pg_size = page_size(page); > > > off = 0; > > > } > > > > I didn't do anything with this. I assume the original patch (which > > has been in -next since July 22) is good and the above is merely a cleanup? > > Yes, just a cleanup. Since Atul didn't offer an opinion, I assume he doesn't > care. Agreed I think what went in is fine. Ira