pblk-write.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  1. /*
  2. * Copyright (C) 2016 CNEX Labs
  3. * Initial release: Javier Gonzalez <javier@cnexlabs.com>
  4. * Matias Bjorling <matias@cnexlabs.com>
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License version
  8. * 2 as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * General Public License for more details.
  14. *
  15. * pblk-write.c - pblk's write path from write buffer to media
  16. */
  17. #include "pblk.h"
  18. static unsigned long pblk_end_w_bio(struct pblk *pblk, struct nvm_rq *rqd,
  19. struct pblk_c_ctx *c_ctx)
  20. {
  21. struct bio *original_bio;
  22. struct pblk_rb *rwb = &pblk->rwb;
  23. unsigned long ret;
  24. int i;
  25. for (i = 0; i < c_ctx->nr_valid; i++) {
  26. struct pblk_w_ctx *w_ctx;
  27. int pos = c_ctx->sentry + i;
  28. int flags;
  29. w_ctx = pblk_rb_w_ctx(rwb, pos);
  30. flags = READ_ONCE(w_ctx->flags);
  31. if (flags & PBLK_FLUSH_ENTRY) {
  32. flags &= ~PBLK_FLUSH_ENTRY;
  33. /* Release flags on context. Protect from writes */
  34. smp_store_release(&w_ctx->flags, flags);
  35. #ifdef CONFIG_NVM_DEBUG
  36. atomic_dec(&rwb->inflight_flush_point);
  37. #endif
  38. }
  39. while ((original_bio = bio_list_pop(&w_ctx->bios)))
  40. bio_endio(original_bio);
  41. }
  42. if (c_ctx->nr_padded)
  43. pblk_bio_free_pages(pblk, rqd->bio, c_ctx->nr_valid,
  44. c_ctx->nr_padded);
  45. #ifdef CONFIG_NVM_DEBUG
  46. atomic_long_add(rqd->nr_ppas, &pblk->sync_writes);
  47. #endif
  48. ret = pblk_rb_sync_advance(&pblk->rwb, c_ctx->nr_valid);
  49. bio_put(rqd->bio);
  50. pblk_free_rqd(pblk, rqd, PBLK_WRITE);
  51. return ret;
  52. }
  53. static unsigned long pblk_end_queued_w_bio(struct pblk *pblk,
  54. struct nvm_rq *rqd,
  55. struct pblk_c_ctx *c_ctx)
  56. {
  57. list_del(&c_ctx->list);
  58. return pblk_end_w_bio(pblk, rqd, c_ctx);
  59. }
  60. static void pblk_complete_write(struct pblk *pblk, struct nvm_rq *rqd,
  61. struct pblk_c_ctx *c_ctx)
  62. {
  63. struct pblk_c_ctx *c, *r;
  64. unsigned long flags;
  65. unsigned long pos;
  66. #ifdef CONFIG_NVM_DEBUG
  67. atomic_long_sub(c_ctx->nr_valid, &pblk->inflight_writes);
  68. #endif
  69. pblk_up_rq(pblk, rqd->ppa_list, rqd->nr_ppas, c_ctx->lun_bitmap);
  70. pos = pblk_rb_sync_init(&pblk->rwb, &flags);
  71. if (pos == c_ctx->sentry) {
  72. pos = pblk_end_w_bio(pblk, rqd, c_ctx);
  73. retry:
  74. list_for_each_entry_safe(c, r, &pblk->compl_list, list) {
  75. rqd = nvm_rq_from_c_ctx(c);
  76. if (c->sentry == pos) {
  77. pos = pblk_end_queued_w_bio(pblk, rqd, c);
  78. goto retry;
  79. }
  80. }
  81. } else {
  82. WARN_ON(nvm_rq_from_c_ctx(c_ctx) != rqd);
  83. list_add_tail(&c_ctx->list, &pblk->compl_list);
  84. }
  85. pblk_rb_sync_end(&pblk->rwb, &flags);
  86. }
  87. /* When a write fails, we are not sure whether the block has grown bad or a page
  88. * range is more susceptible to write errors. If a high number of pages fail, we
  89. * assume that the block is bad and we mark it accordingly. In all cases, we
  90. * remap and resubmit the failed entries as fast as possible; if a flush is
  91. * waiting on a completion, the whole stack would stall otherwise.
  92. */
  93. static void pblk_end_w_fail(struct pblk *pblk, struct nvm_rq *rqd)
  94. {
  95. void *comp_bits = &rqd->ppa_status;
  96. struct pblk_c_ctx *c_ctx = nvm_rq_to_pdu(rqd);
  97. struct pblk_rec_ctx *recovery;
  98. struct ppa_addr *ppa_list = rqd->ppa_list;
  99. int nr_ppas = rqd->nr_ppas;
  100. unsigned int c_entries;
  101. int bit, ret;
  102. if (unlikely(nr_ppas == 1))
  103. ppa_list = &rqd->ppa_addr;
  104. recovery = mempool_alloc(pblk->rec_pool, GFP_ATOMIC);
  105. INIT_LIST_HEAD(&recovery->failed);
  106. bit = -1;
  107. while ((bit = find_next_bit(comp_bits, nr_ppas, bit + 1)) < nr_ppas) {
  108. struct pblk_rb_entry *entry;
  109. struct ppa_addr ppa;
  110. /* Logic error */
  111. if (bit > c_ctx->nr_valid) {
  112. WARN_ONCE(1, "pblk: corrupted write request\n");
  113. mempool_free(recovery, pblk->rec_pool);
  114. goto out;
  115. }
  116. ppa = ppa_list[bit];
  117. entry = pblk_rb_sync_scan_entry(&pblk->rwb, &ppa);
  118. if (!entry) {
  119. pr_err("pblk: could not scan entry on write failure\n");
  120. mempool_free(recovery, pblk->rec_pool);
  121. goto out;
  122. }
  123. /* The list is filled first and emptied afterwards. No need for
  124. * protecting it with a lock
  125. */
  126. list_add_tail(&entry->index, &recovery->failed);
  127. }
  128. c_entries = find_first_bit(comp_bits, nr_ppas);
  129. ret = pblk_recov_setup_rq(pblk, c_ctx, recovery, comp_bits, c_entries);
  130. if (ret) {
  131. pr_err("pblk: could not recover from write failure\n");
  132. mempool_free(recovery, pblk->rec_pool);
  133. goto out;
  134. }
  135. INIT_WORK(&recovery->ws_rec, pblk_submit_rec);
  136. queue_work(pblk->close_wq, &recovery->ws_rec);
  137. out:
  138. pblk_complete_write(pblk, rqd, c_ctx);
  139. }
  140. static void pblk_end_io_write(struct nvm_rq *rqd)
  141. {
  142. struct pblk *pblk = rqd->private;
  143. struct pblk_c_ctx *c_ctx = nvm_rq_to_pdu(rqd);
  144. if (rqd->error) {
  145. pblk_log_write_err(pblk, rqd);
  146. return pblk_end_w_fail(pblk, rqd);
  147. }
  148. #ifdef CONFIG_NVM_DEBUG
  149. else
  150. WARN_ONCE(rqd->bio->bi_status, "pblk: corrupted write error\n");
  151. #endif
  152. pblk_complete_write(pblk, rqd, c_ctx);
  153. atomic_dec(&pblk->inflight_io);
  154. }
  155. static void pblk_end_io_write_meta(struct nvm_rq *rqd)
  156. {
  157. struct pblk *pblk = rqd->private;
  158. struct pblk_g_ctx *m_ctx = nvm_rq_to_pdu(rqd);
  159. struct pblk_line *line = m_ctx->private;
  160. struct pblk_emeta *emeta = line->emeta;
  161. int sync;
  162. pblk_up_page(pblk, rqd->ppa_list, rqd->nr_ppas);
  163. if (rqd->error) {
  164. pblk_log_write_err(pblk, rqd);
  165. pr_err("pblk: metadata I/O failed. Line %d\n", line->id);
  166. }
  167. sync = atomic_add_return(rqd->nr_ppas, &emeta->sync);
  168. if (sync == emeta->nr_entries)
  169. pblk_gen_run_ws(pblk, line, NULL, pblk_line_close_ws,
  170. GFP_ATOMIC, pblk->close_wq);
  171. pblk_free_rqd(pblk, rqd, PBLK_WRITE_INT);
  172. atomic_dec(&pblk->inflight_io);
  173. }
  174. static int pblk_alloc_w_rq(struct pblk *pblk, struct nvm_rq *rqd,
  175. unsigned int nr_secs,
  176. nvm_end_io_fn(*end_io))
  177. {
  178. struct nvm_tgt_dev *dev = pblk->dev;
  179. /* Setup write request */
  180. rqd->opcode = NVM_OP_PWRITE;
  181. rqd->nr_ppas = nr_secs;
  182. rqd->flags = pblk_set_progr_mode(pblk, PBLK_WRITE);
  183. rqd->private = pblk;
  184. rqd->end_io = end_io;
  185. rqd->meta_list = nvm_dev_dma_alloc(dev->parent, GFP_KERNEL,
  186. &rqd->dma_meta_list);
  187. if (!rqd->meta_list)
  188. return -ENOMEM;
  189. rqd->ppa_list = rqd->meta_list + pblk_dma_meta_size;
  190. rqd->dma_ppa_list = rqd->dma_meta_list + pblk_dma_meta_size;
  191. return 0;
  192. }
  193. static int pblk_setup_w_rq(struct pblk *pblk, struct nvm_rq *rqd,
  194. struct ppa_addr *erase_ppa)
  195. {
  196. struct pblk_line_meta *lm = &pblk->lm;
  197. struct pblk_line *e_line = pblk_line_get_erase(pblk);
  198. struct pblk_c_ctx *c_ctx = nvm_rq_to_pdu(rqd);
  199. unsigned int valid = c_ctx->nr_valid;
  200. unsigned int padded = c_ctx->nr_padded;
  201. unsigned int nr_secs = valid + padded;
  202. unsigned long *lun_bitmap;
  203. int ret;
  204. lun_bitmap = kzalloc(lm->lun_bitmap_len, GFP_KERNEL);
  205. if (!lun_bitmap)
  206. return -ENOMEM;
  207. c_ctx->lun_bitmap = lun_bitmap;
  208. ret = pblk_alloc_w_rq(pblk, rqd, nr_secs, pblk_end_io_write);
  209. if (ret) {
  210. kfree(lun_bitmap);
  211. return ret;
  212. }
  213. if (likely(!e_line || !atomic_read(&e_line->left_eblks)))
  214. pblk_map_rq(pblk, rqd, c_ctx->sentry, lun_bitmap, valid, 0);
  215. else
  216. pblk_map_erase_rq(pblk, rqd, c_ctx->sentry, lun_bitmap,
  217. valid, erase_ppa);
  218. return 0;
  219. }
  220. int pblk_setup_w_rec_rq(struct pblk *pblk, struct nvm_rq *rqd,
  221. struct pblk_c_ctx *c_ctx)
  222. {
  223. struct pblk_line_meta *lm = &pblk->lm;
  224. unsigned long *lun_bitmap;
  225. int ret;
  226. lun_bitmap = kzalloc(lm->lun_bitmap_len, GFP_KERNEL);
  227. if (!lun_bitmap)
  228. return -ENOMEM;
  229. c_ctx->lun_bitmap = lun_bitmap;
  230. ret = pblk_alloc_w_rq(pblk, rqd, rqd->nr_ppas, pblk_end_io_write);
  231. if (ret)
  232. return ret;
  233. pblk_map_rq(pblk, rqd, c_ctx->sentry, lun_bitmap, c_ctx->nr_valid, 0);
  234. rqd->ppa_status = (u64)0;
  235. rqd->flags = pblk_set_progr_mode(pblk, PBLK_WRITE);
  236. return ret;
  237. }
  238. static int pblk_calc_secs_to_sync(struct pblk *pblk, unsigned int secs_avail,
  239. unsigned int secs_to_flush)
  240. {
  241. int secs_to_sync;
  242. secs_to_sync = pblk_calc_secs(pblk, secs_avail, secs_to_flush);
  243. #ifdef CONFIG_NVM_DEBUG
  244. if ((!secs_to_sync && secs_to_flush)
  245. || (secs_to_sync < 0)
  246. || (secs_to_sync > secs_avail && !secs_to_flush)) {
  247. pr_err("pblk: bad sector calculation (a:%d,s:%d,f:%d)\n",
  248. secs_avail, secs_to_sync, secs_to_flush);
  249. }
  250. #endif
  251. return secs_to_sync;
  252. }
  253. int pblk_submit_meta_io(struct pblk *pblk, struct pblk_line *meta_line)
  254. {
  255. struct nvm_tgt_dev *dev = pblk->dev;
  256. struct nvm_geo *geo = &dev->geo;
  257. struct pblk_line_mgmt *l_mg = &pblk->l_mg;
  258. struct pblk_line_meta *lm = &pblk->lm;
  259. struct pblk_emeta *emeta = meta_line->emeta;
  260. struct pblk_g_ctx *m_ctx;
  261. struct bio *bio;
  262. struct nvm_rq *rqd;
  263. void *data;
  264. u64 paddr;
  265. int rq_ppas = pblk->min_write_pgs;
  266. int id = meta_line->id;
  267. int rq_len;
  268. int i, j;
  269. int ret;
  270. rqd = pblk_alloc_rqd(pblk, PBLK_WRITE_INT);
  271. m_ctx = nvm_rq_to_pdu(rqd);
  272. m_ctx->private = meta_line;
  273. rq_len = rq_ppas * geo->sec_size;
  274. data = ((void *)emeta->buf) + emeta->mem;
  275. bio = pblk_bio_map_addr(pblk, data, rq_ppas, rq_len,
  276. l_mg->emeta_alloc_type, GFP_KERNEL);
  277. if (IS_ERR(bio)) {
  278. ret = PTR_ERR(bio);
  279. goto fail_free_rqd;
  280. }
  281. bio->bi_iter.bi_sector = 0; /* internal bio */
  282. bio_set_op_attrs(bio, REQ_OP_WRITE, 0);
  283. rqd->bio = bio;
  284. ret = pblk_alloc_w_rq(pblk, rqd, rq_ppas, pblk_end_io_write_meta);
  285. if (ret)
  286. goto fail_free_bio;
  287. for (i = 0; i < rqd->nr_ppas; ) {
  288. spin_lock(&meta_line->lock);
  289. paddr = __pblk_alloc_page(pblk, meta_line, rq_ppas);
  290. spin_unlock(&meta_line->lock);
  291. for (j = 0; j < rq_ppas; j++, i++, paddr++)
  292. rqd->ppa_list[i] = addr_to_gen_ppa(pblk, paddr, id);
  293. }
  294. emeta->mem += rq_len;
  295. if (emeta->mem >= lm->emeta_len[0]) {
  296. spin_lock(&l_mg->close_lock);
  297. list_del(&meta_line->list);
  298. spin_unlock(&l_mg->close_lock);
  299. }
  300. pblk_down_page(pblk, rqd->ppa_list, rqd->nr_ppas);
  301. ret = pblk_submit_io(pblk, rqd);
  302. if (ret) {
  303. pr_err("pblk: emeta I/O submission failed: %d\n", ret);
  304. goto fail_rollback;
  305. }
  306. return NVM_IO_OK;
  307. fail_rollback:
  308. pblk_up_page(pblk, rqd->ppa_list, rqd->nr_ppas);
  309. spin_lock(&l_mg->close_lock);
  310. pblk_dealloc_page(pblk, meta_line, rq_ppas);
  311. list_add(&meta_line->list, &meta_line->list);
  312. spin_unlock(&l_mg->close_lock);
  313. fail_free_bio:
  314. bio_put(bio);
  315. fail_free_rqd:
  316. pblk_free_rqd(pblk, rqd, PBLK_WRITE_INT);
  317. return ret;
  318. }
  319. static inline bool pblk_valid_meta_ppa(struct pblk *pblk,
  320. struct pblk_line *meta_line,
  321. struct nvm_rq *data_rqd)
  322. {
  323. struct nvm_tgt_dev *dev = pblk->dev;
  324. struct nvm_geo *geo = &dev->geo;
  325. struct pblk_c_ctx *data_c_ctx = nvm_rq_to_pdu(data_rqd);
  326. struct pblk_line *data_line = pblk_line_get_data(pblk);
  327. struct ppa_addr ppa, ppa_opt;
  328. u64 paddr;
  329. int pos_opt;
  330. /* Schedule a metadata I/O that is half the distance from the data I/O
  331. * with regards to the number of LUNs forming the pblk instance. This
  332. * balances LUN conflicts across every I/O.
  333. *
  334. * When the LUN configuration changes (e.g., due to GC), this distance
  335. * can align, which would result on metadata and data I/Os colliding. In
  336. * this case, modify the distance to not be optimal, but move the
  337. * optimal in the right direction.
  338. */
  339. paddr = pblk_lookup_page(pblk, meta_line);
  340. ppa = addr_to_gen_ppa(pblk, paddr, 0);
  341. ppa_opt = addr_to_gen_ppa(pblk, paddr + data_line->meta_distance, 0);
  342. pos_opt = pblk_ppa_to_pos(geo, ppa_opt);
  343. if (test_bit(pos_opt, data_c_ctx->lun_bitmap) ||
  344. test_bit(pos_opt, data_line->blk_bitmap))
  345. return true;
  346. if (unlikely(pblk_ppa_comp(ppa_opt, ppa)))
  347. data_line->meta_distance--;
  348. return false;
  349. }
  350. static struct pblk_line *pblk_should_submit_meta_io(struct pblk *pblk,
  351. struct nvm_rq *data_rqd)
  352. {
  353. struct pblk_line_meta *lm = &pblk->lm;
  354. struct pblk_line_mgmt *l_mg = &pblk->l_mg;
  355. struct pblk_line *meta_line;
  356. spin_lock(&l_mg->close_lock);
  357. retry:
  358. if (list_empty(&l_mg->emeta_list)) {
  359. spin_unlock(&l_mg->close_lock);
  360. return NULL;
  361. }
  362. meta_line = list_first_entry(&l_mg->emeta_list, struct pblk_line, list);
  363. if (meta_line->emeta->mem >= lm->emeta_len[0])
  364. goto retry;
  365. spin_unlock(&l_mg->close_lock);
  366. if (!pblk_valid_meta_ppa(pblk, meta_line, data_rqd))
  367. return NULL;
  368. return meta_line;
  369. }
  370. static int pblk_submit_io_set(struct pblk *pblk, struct nvm_rq *rqd)
  371. {
  372. struct ppa_addr erase_ppa;
  373. struct pblk_line *meta_line;
  374. int err;
  375. pblk_ppa_set_empty(&erase_ppa);
  376. /* Assign lbas to ppas and populate request structure */
  377. err = pblk_setup_w_rq(pblk, rqd, &erase_ppa);
  378. if (err) {
  379. pr_err("pblk: could not setup write request: %d\n", err);
  380. return NVM_IO_ERR;
  381. }
  382. meta_line = pblk_should_submit_meta_io(pblk, rqd);
  383. /* Submit data write for current data line */
  384. err = pblk_submit_io(pblk, rqd);
  385. if (err) {
  386. pr_err("pblk: data I/O submission failed: %d\n", err);
  387. return NVM_IO_ERR;
  388. }
  389. if (!pblk_ppa_empty(erase_ppa)) {
  390. /* Submit erase for next data line */
  391. if (pblk_blk_erase_async(pblk, erase_ppa)) {
  392. struct pblk_line *e_line = pblk_line_get_erase(pblk);
  393. struct nvm_tgt_dev *dev = pblk->dev;
  394. struct nvm_geo *geo = &dev->geo;
  395. int bit;
  396. atomic_inc(&e_line->left_eblks);
  397. bit = pblk_ppa_to_pos(geo, erase_ppa);
  398. WARN_ON(!test_and_clear_bit(bit, e_line->erase_bitmap));
  399. }
  400. }
  401. if (meta_line) {
  402. /* Submit metadata write for previous data line */
  403. err = pblk_submit_meta_io(pblk, meta_line);
  404. if (err) {
  405. pr_err("pblk: metadata I/O submission failed: %d", err);
  406. return NVM_IO_ERR;
  407. }
  408. }
  409. return NVM_IO_OK;
  410. }
  411. static void pblk_free_write_rqd(struct pblk *pblk, struct nvm_rq *rqd)
  412. {
  413. struct pblk_c_ctx *c_ctx = nvm_rq_to_pdu(rqd);
  414. struct bio *bio = rqd->bio;
  415. if (c_ctx->nr_padded)
  416. pblk_bio_free_pages(pblk, bio, c_ctx->nr_valid,
  417. c_ctx->nr_padded);
  418. }
  419. static int pblk_submit_write(struct pblk *pblk)
  420. {
  421. struct bio *bio;
  422. struct nvm_rq *rqd;
  423. unsigned int secs_avail, secs_to_sync, secs_to_com;
  424. unsigned int secs_to_flush;
  425. unsigned long pos;
  426. /* If there are no sectors in the cache, flushes (bios without data)
  427. * will be cleared on the cache threads
  428. */
  429. secs_avail = pblk_rb_read_count(&pblk->rwb);
  430. if (!secs_avail)
  431. return 1;
  432. secs_to_flush = pblk_rb_flush_point_count(&pblk->rwb);
  433. if (!secs_to_flush && secs_avail < pblk->min_write_pgs)
  434. return 1;
  435. secs_to_sync = pblk_calc_secs_to_sync(pblk, secs_avail, secs_to_flush);
  436. if (secs_to_sync > pblk->max_write_pgs) {
  437. pr_err("pblk: bad buffer sync calculation\n");
  438. return 1;
  439. }
  440. secs_to_com = (secs_to_sync > secs_avail) ? secs_avail : secs_to_sync;
  441. pos = pblk_rb_read_commit(&pblk->rwb, secs_to_com);
  442. bio = bio_alloc(GFP_KERNEL, secs_to_sync);
  443. bio->bi_iter.bi_sector = 0; /* internal bio */
  444. bio_set_op_attrs(bio, REQ_OP_WRITE, 0);
  445. rqd = pblk_alloc_rqd(pblk, PBLK_WRITE);
  446. rqd->bio = bio;
  447. if (pblk_rb_read_to_bio(&pblk->rwb, rqd, pos, secs_to_sync,
  448. secs_avail)) {
  449. pr_err("pblk: corrupted write bio\n");
  450. goto fail_put_bio;
  451. }
  452. if (pblk_submit_io_set(pblk, rqd))
  453. goto fail_free_bio;
  454. #ifdef CONFIG_NVM_DEBUG
  455. atomic_long_add(secs_to_sync, &pblk->sub_writes);
  456. #endif
  457. return 0;
  458. fail_free_bio:
  459. pblk_free_write_rqd(pblk, rqd);
  460. fail_put_bio:
  461. bio_put(bio);
  462. pblk_free_rqd(pblk, rqd, PBLK_WRITE);
  463. return 1;
  464. }
  465. int pblk_write_ts(void *data)
  466. {
  467. struct pblk *pblk = data;
  468. while (!kthread_should_stop()) {
  469. if (!pblk_submit_write(pblk))
  470. continue;
  471. set_current_state(TASK_INTERRUPTIBLE);
  472. io_schedule();
  473. }
  474. return 0;
  475. }