Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4793080imm; Mon, 17 Sep 2018 22:27:48 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbHwuQUuK3MRsuQsgpwavg5TaZcVRIzv/7BhZODgom3W/IzcWNs3m1UfxuDquH2mTJg/GZn X-Received: by 2002:a62:586:: with SMTP id 128-v6mr29081583pff.80.1537248468572; Mon, 17 Sep 2018 22:27:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537248468; cv=none; d=google.com; s=arc-20160816; b=X5hQzpAfQnGzVM9h5Rj91kNO+XqU4o1xsVEI0tLK+wvKPr5H5wRylF0giRoU1gnr9I CqrDJ7E3gFRSN67trh4ZiCnPpDRy7kw6FxL0cYokNL7xL+PFHV/zSXVNkd7KVZZLsVb0 VgjzSX3vKMLvnTZTjQwYKSS804xh+yo019ZEaZ2I7YyhNLb9u7XiWEsQ4qEdh9Il3lsk qdDWgBMP1mntaTeBiFJ1RnRog5ttTTofu9pnniEsSbtn8ygbFj9bRdWjSxskvJjdmyTU kG2/jraf7CsPUFTtNA11KkVSxXNaCukLm+2XbvOFBiDhvENEgSZar5aowhFy42ZNxa5r zE4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:dkim-signature; bh=JoCDdnUkD7o5IrNl3TI40egmg9e0KqbSrhA98FhS5cM=; b=DV2wQLHV3N5IZ3dkFwRc3Svw7W5ukxu6aCtYbcVh9wyyLTs7xNhIc7uTEbP+j+Vc/q JxYL6f0GfXwY7HnWE2n6yYUYmMBWoprJ61qm1Bde3HKSpq42+msCFLSlxPBDkH33zQoC rija5S7rRXIcOGl52HT5zF27yp0irEghkvsMkmKvaWFKVPWAH6nKaVmrynqIsgvrzcBv 5ZH4IKWuT/5zDy9JGuqRqIw19iKwnV9ihuKrOGm3l1x7OlaDWh12I+R3JECxlMZVWS2W hDK6uHRr+/wZJfMJEJZUlgMTCquoXILFN03mEpNkhdBGM8QAJVyy9YqQ90iXUHnRA8vI avpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=kFn4WLyz; 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 c12-v6si15062495plr.32.2018.09.17.22.27.31; Mon, 17 Sep 2018 22:27:48 -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=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=kFn4WLyz; 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 S1727404AbeIRK6T (ORCPT + 99 others); Tue, 18 Sep 2018 06:58:19 -0400 Received: from mail-sn1nam01on0087.outbound.protection.outlook.com ([104.47.32.87]:44064 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726433AbeIRK6T (ORCPT ); Tue, 18 Sep 2018 06:58:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JoCDdnUkD7o5IrNl3TI40egmg9e0KqbSrhA98FhS5cM=; b=kFn4WLyzVuV7ex7wCt7ckeMO1U5BKboKpLiUuTQigogpRZfrT23JlXY3/A5Y6SVjeoVB+Wir81kVjqqO0lL20k6e/ptJWnDXnk8n/QSdjBsIESxahLc2QUfLBptWq1KsQq/A8biu9SkWQ0zUZfKiygaMhDkmSn5r3lDfhxxWTwY= Received: from SN1PR12CA0066.namprd12.prod.outlook.com (2603:10b6:802:20::37) by BY1PR12MB0422.namprd12.prod.outlook.com (2a01:111:e400:51b2::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Tue, 18 Sep 2018 05:27:20 +0000 Received: from CO1NAM03FT044.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::209) by SN1PR12CA0066.outlook.office365.com (2603:10b6:802:20::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1143.18 via Frontend Transport; Tue, 18 Sep 2018 05:27:19 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by CO1NAM03FT044.mail.protection.outlook.com (10.152.81.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.1164.13 via Frontend Transport; Tue, 18 Sep 2018 05:27:19 +0000 Received: from [10.237.40.91] (10.34.1.3) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server (TLS) id 14.3.389.1; Tue, 18 Sep 2018 00:27:18 -0500 Subject: Re: [PATCH] list: introduce list_bulk_move_tail helper To: =?UTF-8?Q?Christian_K=c3=b6nig?= , , , References: <20180917120834.13993-1-christian.koenig@amd.com> From: "Zhang, Jerry(Junwei)" Message-ID: <3d3d1448-fac0-947c-0381-09f7f8ac9bd6@amd.com> Date: Tue, 18 Sep 2018 13:27:12 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180917120834.13993-1-christian.koenig@amd.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [10.34.1.3] X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(39860400002)(396003)(346002)(376002)(136003)(2980300002)(428003)(189003)(199004)(53936002)(16576012)(126002)(6116002)(3846002)(2616005)(47776003)(81166006)(58126008)(426003)(72206003)(8676002)(316002)(81156014)(356003)(446003)(2201001)(31696002)(104016004)(110136005)(7736002)(86362001)(486006)(68736007)(11346002)(53546011)(8936002)(305945005)(476003)(67846002)(478600001)(64126003)(2870700001)(186003)(26005)(106466001)(2906002)(65806001)(50466002)(105586002)(77096007)(5660300001)(336012)(6666003)(39060400002)(36756003)(97736004)(31686004)(23676004)(2486003)(16526019)(6246003)(65956001)(76176011)(65826007)(229853002);DIR:OUT;SFP:1101;SCL:1;SRVR:BY1PR12MB0422;H:SATLEXCHOV02.amd.com;FPR:;SPF:None;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM03FT044;1:NTyj8WYdM5NZn64/n8BVYj73tfsj1DMgW9MFvSBOB436+0QzkveopXVLQvdfUiCu4FMKmc497hg71yfF2zbTE8Tj7MPTC4bQf+ixy3DdaXA36Q+GlrQy+n10Iy0Q0LcJ X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 819cf727-794a-43ba-e61f-08d61d27677f X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052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lFEzukyzbZKpzI3cVc=;20:phsuPzU7hfBzzF8VpF1AI5Kn0AcTehZGNUSOi755X0hvg4IaenWI1bN9HLS3npLXt02wC4RhwQNHVWqUPJP++uMdNXiv0DIcHOTNWMgiHOaILKVuIkkSYX8rbGHIdtxlwILYNsCYwRNL9mUvwrt6Zq+DjJNfmjIkwBVzOUsjZbbm53nwMTr8HNLzd/NN0UT9Hg7bfIj3Zrm3/kyIpYrTdJHKYnFC/77g9hKwPB4VQVrXsPoz/+XOGjEW047AWEZcJK/+UGD8em7mU0+Qyv/HdWVzzJIW0n9UAswWHwlvRmgCc0BeS5lHfFSFpdeSLFf2d0AfMr4/ODP+8ygLNKwz5vaCvH65Q0CT8WrD3+Hh0HotQY43Y/FVs3JfWiz3bCAZKboqekyZXY2IAdpV/CeD2+Zu2HHeGI+jPo4c1y4Smz4P070H7MHQPxg7cycpNjM6Iu5SPY/GhM+UDxZFtAbjsaAGNJAnWfr9Ms8TnI2dZABY7yGwnrriK7I5fABE2fiR X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231355)(944501410)(52105095)(93006095)(93003095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(201708071742011)(7699050);SRVR:BY1PR12MB0422;BCL:0;PCL:0;RULEID:;SRVR:BY1PR12MB0422; X-Microsoft-Exchange-Diagnostics: 1;BY1PR12MB0422;4:82lpR6cA2cPr2uvj14quWvZRWj3DBLHxmGJAQxwZ6MoU4XZAzZRhNIVbGVg0Nk7CcslxXyIjSBT7nbDYQBXm7gEoTKAZlPjsgxHnmIJntjT7r0VCc7VYTDLB83XVWu4EkS2POb86HWPUM+aswwHAQmln1GVOhvN64nm0UH4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xQB6L/TN7IkSyAqEspUaQp6onAPqylh900wgQ+fFmfBrVIcJVudYQKQoAMcu8Bp0FcGa2w/Vm0bn5FwevpymluiQq1LCarCQA9SsMHpMJ5rDDUduSBVIQemnTmIS1oEy8K6dmmOquTNsS9n2zkLlgz142sXhzMoLWGnJ4T+oJDclgu8dU4cIEktCFa99eIrZ/zorUIUQkFzLzoMdgdt1BafGMthbi/bAbEhIAc7A==;5:xiwwfQqWE0tAWxBOq/sRlMs/3uUasjd8lWKy+u2RKH5YHqEPBpOPc7FDrsa/tVZo/1o4dj4p90EwOA25Rg1fYwrMAdyLcMCJ1b01P0ubkRpTMe7ELxPNpC7KUf4nFrS9gSQfeOeHaGwlZnuaYzeu8phQn1bnG9VuQfpmL8ptxxE=;7:mX+tRQ1hJ6mLPuELQu2ILJwvvnlaTqF7ggFl4D/XzLA53pEO/Wxv8V8XBnY++/TFrw2P0Oy4V1MyzK56OPQP1bd9WiwjxChKAkWXncVUXuCzIqOqkpVlOYdQxoK2GPn8Lta01TodGI6mUR29BZILFIegj2oLQbJvIzOKbmkF1gelt1uOy4WNYzBikFd0i7QGwme93Tv6g+Q+ATL/bWGPvEXTjuXzGvT/BalnTGYW78hOaowREMXm/l+O55Dit4Jp SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BY1PR12MB0422;20:5/ldJC7Jl2Y5doW5UAlq2fYX1tMNvFijibL999XFGGyPjeJLIqHyRV67w/YC8WmzhjffEENFffMUOev+o1vQ2CYj9+42WFaKesIeH8d12lJduLIVtQXOEk3muJEA7XhJvalSmUeOQ2yaVC8UO58OScLuzP1u2vXGXuUpLuZbqwJLPdXfOl0Rhn0dSoNN0Am+d69WcFOd5mwS+t0wPIMHZy17vmF5i5RS4eVL+ojihSDB8MwesFcdfoJtKmABFirK X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2018 05:27:19.4681 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 819cf727-794a-43ba-e61f-08d61d27677f X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR12MB0422 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/17/2018 08:08 PM, Christian König wrote: > Move all entries between @first and including @last before @head. > > This is useful for LRU lists where a whole block of entries should be > moved to the end of the list. > > Used as a band aid in TTM, but better placed in the common list headers. > > Signed-off-by: Christian König Reviewed-by: Junwei Zhang > --- > drivers/gpu/drm/ttm/ttm_bo.c | 25 +++++-------------------- > include/linux/list.h | 23 +++++++++++++++++++++++ > 2 files changed, 28 insertions(+), 20 deletions(-) > > diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c > index b2a33bf1ef10..26b889f86670 100644 > --- a/drivers/gpu/drm/ttm/ttm_bo.c > +++ b/drivers/gpu/drm/ttm/ttm_bo.c > @@ -247,20 +247,6 @@ void ttm_bo_move_to_lru_tail(struct ttm_buffer_object *bo, > } > EXPORT_SYMBOL(ttm_bo_move_to_lru_tail); > > -static void ttm_list_move_bulk_tail(struct list_head *list, > - struct list_head *first, > - struct list_head *last) > -{ > - first->prev->next = last->next; > - last->next->prev = first->prev; > - > - list->prev->next = first; > - first->prev = list->prev; > - > - last->next = list; > - list->prev = last; > -} > - > void ttm_bo_bulk_move_lru_tail(struct ttm_lru_bulk_move *bulk) > { > unsigned i; > @@ -276,8 +262,8 @@ void ttm_bo_bulk_move_lru_tail(struct ttm_lru_bulk_move *bulk) > reservation_object_assert_held(pos->last->resv); > > man = &pos->first->bdev->man[TTM_PL_TT]; > - ttm_list_move_bulk_tail(&man->lru[i], &pos->first->lru, > - &pos->last->lru); > + list_bulk_move_tail(&man->lru[i], &pos->first->lru, > + &pos->last->lru); > } > > for (i = 0; i < TTM_MAX_BO_PRIORITY; ++i) { > @@ -291,8 +277,8 @@ void ttm_bo_bulk_move_lru_tail(struct ttm_lru_bulk_move *bulk) > reservation_object_assert_held(pos->last->resv); > > man = &pos->first->bdev->man[TTM_PL_VRAM]; > - ttm_list_move_bulk_tail(&man->lru[i], &pos->first->lru, > - &pos->last->lru); > + list_bulk_move_tail(&man->lru[i], &pos->first->lru, > + &pos->last->lru); > } > > for (i = 0; i < TTM_MAX_BO_PRIORITY; ++i) { > @@ -306,8 +292,7 @@ void ttm_bo_bulk_move_lru_tail(struct ttm_lru_bulk_move *bulk) > reservation_object_assert_held(pos->last->resv); > > lru = &pos->first->bdev->glob->swap_lru[i]; > - ttm_list_move_bulk_tail(lru, &pos->first->swap, > - &pos->last->swap); > + list_bulk_move_tail(lru, &pos->first->swap, &pos->last->swap); > } > } > EXPORT_SYMBOL(ttm_bo_bulk_move_lru_tail); > diff --git a/include/linux/list.h b/include/linux/list.h > index de04cc5ed536..edb7628e46ed 100644 > --- a/include/linux/list.h > +++ b/include/linux/list.h > @@ -183,6 +183,29 @@ static inline void list_move_tail(struct list_head *list, > list_add_tail(list, head); > } > > +/** > + * list_bulk_move_tail - move a subsection of a list to its tail > + * @head: the head that will follow our entry > + * @first: first entry to move > + * @last: last entry to move, can be the same as first > + * > + * Move all entries between @first and including @last before @head. > + * All three entries must belong to the same linked list. > + */ > +static inline void list_bulk_move_tail(struct list_head *head, > + struct list_head *first, > + struct list_head *last) > +{ > + first->prev->next = last->next; > + last->next->prev = first->prev; > + > + head->prev->next = first; > + first->prev = head->prev; > + > + last->next = head; > + head->prev = last; > +} > + > /** > * list_is_last - tests whether @list is the last entry in list @head > * @list: the entry to test